@@ -39,18 +39,47 @@ export interface AgentRunOptionsBase {
3939 tools ?: Tools [ ] ;
4040 tool_choice ?: 'auto' | 'required' | ToolChoice ;
4141 parallel_tool_calls ?: boolean ;
42+ mcp_servers ?: McpServerSchema [ ] ;
4243 reasoning_effort ?: string | null ;
4344 max_completion_tokens ?: number ;
4445 response_format ?: ResponseFormat ;
4546 customModelParams ?: Record < string , any > ;
4647}
4748
48- export interface AgentRunOptions extends AgentRunOptionsBase {
49+ export type AgentRunOptionsWithoutMcp = Omit <
50+ AgentRunOptionsBase ,
51+ 'mcp_servers'
52+ > & {
4953 stream ?: false ;
50- }
54+ } ;
5155
52- export interface AgentRunOptionsStream extends AgentRunOptionsBase {
56+ export type AgentRunOptionsWithMcp = AgentRunOptionsBase & {
57+ mcp_servers : McpServerSchema [ ] ;
58+ stream : false ;
59+ } ;
60+
61+ export type AgentRunOptionsStreamT = Omit <
62+ AgentRunOptionsBase ,
63+ 'mcp_servers'
64+ > & {
5365 stream : true ;
66+ } ;
67+
68+ export type AgentRunOptions =
69+ | AgentRunOptionsWithoutMcp
70+ | AgentRunOptionsWithMcp ;
71+ export type AgentRunOptionsStream = AgentRunOptionsStreamT ;
72+
73+ export interface McpServerSchema {
74+ name : string ;
75+ type : 'url' ;
76+ url : string ;
77+ authorization_token ?: string ;
78+ tool_configuration ?: {
79+ allowed_tools ?: string [ ] ;
80+ enabled ?: boolean ;
81+ } ;
82+ custom_headers ?: Record < string , string > ;
5483}
5584
5685interface ChoiceGenerate {
@@ -476,6 +505,13 @@ export interface ThreadMessagesBaseResponse {
476505 metadata : Record < string , string > | { } ;
477506}
478507
508+ interface ChoiceGenerate {
509+ index : number ;
510+ message : Message ;
511+ logprobs : boolean | null ;
512+ finish_reason : string ;
513+ }
514+
479515export class Langbase {
480516 private request : Request ;
481517 private apiKey : string ;
0 commit comments