@@ -39,18 +39,39 @@ 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 < AgentRunOptionsBase , 'mcp_servers' > & {
4950 stream ?: false ;
50- }
51+ } ;
52+
53+ export type AgentRunOptionsWithMcp = AgentRunOptionsBase & {
54+ mcp_servers : McpServerSchema [ ] ;
55+ stream : false ;
56+ } ;
5157
52- export interface AgentRunOptionsStream extends AgentRunOptionsBase {
58+ export type AgentRunOptionsStreamT = Omit < AgentRunOptionsBase , 'mcp_servers' > & {
5359 stream : true ;
60+ } ;
61+
62+ export type AgentRunOptions = AgentRunOptionsWithoutMcp | AgentRunOptionsWithMcp ;
63+ export type AgentRunOptionsStream = AgentRunOptionsStreamT ;
64+
65+ export interface McpServerSchema {
66+ name : string ;
67+ type : 'url' ;
68+ url : string ;
69+ authorization_token ?: string ;
70+ tool_configuration ?: {
71+ allowed_tools ?: string [ ] ;
72+ enabled ?: boolean ;
73+ }
74+ custom_headers ?: Record < string , string >
5475}
5576
5677interface ChoiceGenerate {
@@ -476,6 +497,13 @@ export interface ThreadMessagesBaseResponse {
476497 metadata : Record < string , string > | { } ;
477498}
478499
500+ interface ChoiceGenerate {
501+ index : number ;
502+ message : Message ;
503+ logprobs : boolean | null ;
504+ finish_reason : string ;
505+ }
506+
479507export class Langbase {
480508 private request : Request ;
481509 private apiKey : string ;
0 commit comments