File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
- import { BitteToolResult } from "@bitte-ai/types" ;
2
-
3
1
const BITTE_API_URL =
4
2
"https://ai-runtime-446257178793.europe-west1.run.app/chat" ;
5
3
4
+ export interface ToolResult {
5
+ toolCallId : string ;
6
+ result : {
7
+ error ?: string ;
8
+ data ?: unknown ;
9
+ } ;
10
+ }
11
+
6
12
export interface AgentResponse {
7
13
content : string ;
8
- toolResults : BitteToolResult [ ] ;
14
+ toolResults : ToolResult [ ] ;
9
15
messageId : string ;
10
16
finishReason : string ;
11
17
agentId : string ;
@@ -123,11 +129,10 @@ export async function callAgent(
123
129
124
130
return {
125
131
content : content . trim ( ) ,
126
- toolResults : toolResults . map ( ( toolResult ) =>
127
- toolResult . result . error
128
- ? { error : toolResult . result . error }
129
- : { data : toolResult . result . data } ,
130
- ) ,
132
+ toolResults : toolResults . map ( ( toolResult ) => ( {
133
+ toolCallId : toolResult . toolCallId ,
134
+ result : toolResult . result ,
135
+ } ) ) ,
131
136
messageId,
132
137
finishReason,
133
138
agentId : resultAgentId ,
You can’t perform that action at this time.
0 commit comments