test(core): align tool contract expectations (#39172)
This commit is contained in:
parent
f15398efc3
commit
470e360942
13 changed files with 333 additions and 116 deletions
|
|
@ -110,7 +110,7 @@ export type SessionMessageToolStateRunning = {
|
|||
|
||||
export type ToolTextContent = { type: "text"; text: string }
|
||||
|
||||
export type ToolFileContent = { type: "file"; uri: string; mime: string; name?: string }
|
||||
export type ToolFileContent = { type: "file"; uri: string; mime: string; name?: string | null }
|
||||
|
||||
export type SessionStructuredError = { type: string; message: string }
|
||||
|
||||
|
|
@ -163,6 +163,8 @@ export type SessionMessageProviderState6 = { [x: string]: any }
|
|||
|
||||
export type SessionMessageProviderState7 = { [x: string]: any }
|
||||
|
||||
export type ToolFileContent1 = { type: "file"; uri: string; mime: string; name?: string | undefined }
|
||||
|
||||
export type SessionMessageProviderState8 = { [x: string]: any }
|
||||
|
||||
export type SessionMessageProviderState9 = { [x: string]: any }
|
||||
|
|
@ -1226,7 +1228,7 @@ export type SessionMessageAssistantReasoning = {
|
|||
time?: { created: number; completed?: number }
|
||||
}
|
||||
|
||||
export type LLMToolContent = ToolTextContent | ToolFileContent
|
||||
export type ToolContent = ToolTextContent | ToolFileContent
|
||||
|
||||
export type SessionMessageAssistantRetry = { attempt: number; at: number; error: SessionStructuredError }
|
||||
|
||||
|
|
@ -1388,6 +1390,8 @@ export type SessionToolCalled = {
|
|||
}
|
||||
}
|
||||
|
||||
export type ToolContent1 = ToolTextContent | ToolFileContent1
|
||||
|
||||
export type ModelCompatibility = { reasoningField?: ModelReasoningField }
|
||||
|
||||
export type ModelCost = {
|
||||
|
|
@ -1801,7 +1805,7 @@ export type SessionPendingUserData1 = {
|
|||
export type SessionMessageToolStateCompleted = {
|
||||
status: "completed"
|
||||
input: { [x: string]: JsonValue }
|
||||
content: [LLMToolContent, ...Array<LLMToolContent>]
|
||||
content: [ToolContent, ...Array<ToolContent>]
|
||||
metadata?: { [x: string]: JsonValue }
|
||||
}
|
||||
|
||||
|
|
@ -1809,10 +1813,15 @@ export type SessionMessageToolStateError = {
|
|||
status: "error"
|
||||
input: { [x: string]: JsonValue }
|
||||
error: SessionStructuredError
|
||||
content?: [LLMToolContent, ...Array<LLMToolContent>]
|
||||
content?: [ToolContent, ...Array<ToolContent>]
|
||||
metadata?: { [x: string]: JsonValue }
|
||||
}
|
||||
|
||||
export type SessionMessageCompaction =
|
||||
| SessionMessageCompactionRunning
|
||||
| SessionMessageCompactionCompleted
|
||||
| SessionMessageCompactionFailed
|
||||
|
||||
export type SessionToolSuccess = {
|
||||
id: string
|
||||
created: number
|
||||
|
|
@ -1824,7 +1833,7 @@ export type SessionToolSuccess = {
|
|||
sessionID: string
|
||||
assistantMessageID: string
|
||||
callID: string
|
||||
content: [LLMToolContent, ...Array<LLMToolContent>]
|
||||
content: [ToolContent1, ...Array<ToolContent1>]
|
||||
metadata?: { [x: string]: JsonValue }
|
||||
executed: boolean
|
||||
resultState?: SessionMessageProviderState8
|
||||
|
|
@ -1843,18 +1852,13 @@ export type SessionToolFailed = {
|
|||
assistantMessageID: string
|
||||
callID: string
|
||||
error: SessionStructuredError
|
||||
content?: [LLMToolContent, ...Array<LLMToolContent>]
|
||||
content?: [ToolContent1, ...Array<ToolContent1>]
|
||||
metadata?: { [x: string]: JsonValue }
|
||||
executed: boolean
|
||||
resultState?: SessionMessageProviderState9
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessageCompaction =
|
||||
| SessionMessageCompactionRunning
|
||||
| SessionMessageCompactionCompleted
|
||||
| SessionMessageCompactionFailed
|
||||
|
||||
export type ModelInfo = {
|
||||
id: string
|
||||
modelID: string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue