feat(tasks): Add model info as part of metadata (#10307)
This commit is contained in:
@@ -99,10 +99,16 @@ export const TaskTool = Tool.define("task", async (ctx) => {
|
|||||||
const msg = await MessageV2.get({ sessionID: ctx.sessionID, messageID: ctx.messageID })
|
const msg = await MessageV2.get({ sessionID: ctx.sessionID, messageID: ctx.messageID })
|
||||||
if (msg.info.role !== "assistant") throw new Error("Not an assistant message")
|
if (msg.info.role !== "assistant") throw new Error("Not an assistant message")
|
||||||
|
|
||||||
|
const model = agent.model ?? {
|
||||||
|
modelID: msg.info.modelID,
|
||||||
|
providerID: msg.info.providerID,
|
||||||
|
}
|
||||||
|
|
||||||
ctx.metadata({
|
ctx.metadata({
|
||||||
title: params.description,
|
title: params.description,
|
||||||
metadata: {
|
metadata: {
|
||||||
sessionId: session.id,
|
sessionId: session.id,
|
||||||
|
model,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -126,15 +132,11 @@ export const TaskTool = Tool.define("task", async (ctx) => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
summary: Object.values(parts).sort((a, b) => a.id.localeCompare(b.id)),
|
summary: Object.values(parts).sort((a, b) => a.id.localeCompare(b.id)),
|
||||||
sessionId: session.id,
|
sessionId: session.id,
|
||||||
|
model,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const model = agent.model ?? {
|
|
||||||
modelID: msg.info.modelID,
|
|
||||||
providerID: msg.info.providerID,
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancel() {
|
function cancel() {
|
||||||
SessionPrompt.cancel(session.id)
|
SessionPrompt.cancel(session.id)
|
||||||
}
|
}
|
||||||
@@ -180,6 +182,7 @@ export const TaskTool = Tool.define("task", async (ctx) => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
summary,
|
summary,
|
||||||
sessionId: session.id,
|
sessionId: session.id,
|
||||||
|
model,
|
||||||
},
|
},
|
||||||
output,
|
output,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user