Skip to content

Commit

Permalink
Add example for fallback models
Browse files Browse the repository at this point in the history
  • Loading branch information
joch committed Nov 12, 2024
1 parent 6b0476f commit f39aec7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/example-calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ const client = new Client();
});
console.log("JSON response with thoughts and reflection: ", strawberry);

const { message: fallbackMessage } = await client.call({
name: "node-sdk/call/fallback-example",
input: "What is the capital of France?",
model: "azure/gpt-4o-eu",
fallback_models: ["openai/gpt-4o"],
});

console.log("Fallback response: ", fallbackMessage);

await trace.end({
output: "example output",
});
Expand Down

0 comments on commit f39aec7

Please sign in to comment.