Skip to content

Instantly share code, notes, and snippets.

@mattpocock
Created January 8, 2025 11:31
Show Gist options
  • Save mattpocock/c6146afc3e910538eccbbefd4ee5df0f to your computer and use it in GitHub Desktop.
Save mattpocock/c6146afc3e910538eccbbefd4ee5df0f to your computer and use it in GitHub Desktop.
const result = [
{
stepType: 'initial',
text: "I'll help you check the current weather in London right away.",
toolCalls: [
{
type: 'tool-call',
toolCallId: 'toolu_011n3T6TJnwZLyR4G8h1ZcMz',
toolName: 'getWeather',
args: { city: 'London' }
}
],
toolResults: [
{
type: 'tool-result',
toolCallId: 'toolu_011n3T6TJnwZLyR4G8h1ZcMz',
toolName: 'getWeather',
args: { city: 'London' },
result: 'The weather in London is 25°C and sunny.'
}
],
finishReason: 'tool-calls',
usage: { promptTokens: 373, completionTokens: 67, totalTokens: 440 },
warnings: undefined,
logprobs: undefined,
request: {},
response: {
id: 'msg_01WfGN9jpR2vDQJQFukLosAs',
timestamp: 2025-01-08T11:26:58.716Z,
modelId: 'claude-3-5-haiku-20241022',
headers: undefined,
messages: [
{
role: 'assistant',
content: [
{
type: 'text',
text: "I'll help you check the current weather in London right away."
},
{
type: 'tool-call',
toolCallId: 'toolu_011n3T6TJnwZLyR4G8h1ZcMz',
toolName: 'getWeather',
args: { city: 'London' }
}
]
},
{
role: 'tool',
content: [
{
type: 'tool-result',
toolCallId: 'toolu_011n3T6TJnwZLyR4G8h1ZcMz',
toolName: 'getWeather',
result: 'The weather in London is 25°C and sunny.'
}
]
}
]
},
experimental_providerMetadata: undefined,
isContinued: false
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment