-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Suppport computer use and sync with new typespec #36101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,7 @@ export interface AgentsNamedToolChoice { | |
} | ||
|
||
// @public | ||
export type AgentsNamedToolChoiceType = "function" | "code_interpreter" | "file_search" | "bing_grounding" | "fabric_dataagent" | "sharepoint_grounding" | "azure_ai_search" | "bing_custom_search" | "connected_agent" | "deep_research" | "mcp"; | ||
export type AgentsNamedToolChoiceType = "function" | "code_interpreter" | "file_search" | "bing_grounding" | "fabric_dataagent" | "sharepoint_grounding" | "azure_ai_search" | "bing_custom_search" | "connected_agent" | "deep_research" | "mcp" | "computer_use_preview"; | ||
|
||
// @public | ||
export interface AgentsResponseFormat { | ||
|
@@ -276,6 +276,14 @@ export interface BrowserAutomationToolParameters { | |
connection: BrowserAutomationToolConnectionParameters; | ||
} | ||
|
||
// @public | ||
export interface ClickAction extends ComputerUseAction { | ||
button: MouseButton; | ||
type: "click"; | ||
x: number; | ||
y: number; | ||
} | ||
|
||
// @public | ||
export interface CodeInterpreterToolDefinition extends ToolDefinition { | ||
type: "code_interpreter"; | ||
|
@@ -287,6 +295,44 @@ export interface CodeInterpreterToolResource { | |
fileIds?: string[]; | ||
} | ||
|
||
// @public | ||
export interface ComputerScreenshot { | ||
fileId?: string; | ||
imageUrl?: string; | ||
type: "computer_screenshot"; | ||
} | ||
|
||
// @public | ||
export interface ComputerToolOutput extends StructuredToolOutput { | ||
acknowledgedSafetyChecks?: SafetyCheck[]; | ||
output: ComputerScreenshot; | ||
type: "computer_call_output"; | ||
} | ||
|
||
// @public | ||
export interface ComputerUseAction { | ||
type: string; | ||
} | ||
|
||
// @public | ||
export type ComputerUseActionUnion = ClickAction | DoubleClickAction | DragAction | KeyPressAction | MoveAction | ScreenshotAction | ScrollAction | TypeAction | WaitAction | ComputerUseAction; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the base I would say this main type should be |
||
|
||
// @public | ||
export type ComputerUseEnvironment = "windows" | "mac" | "linux" | "browser"; | ||
|
||
// @public | ||
export interface ComputerUseToolDefinition extends ToolDefinition { | ||
computerUsePreview: ComputerUseToolParameters; | ||
type: "computer_use_preview"; | ||
} | ||
|
||
// @public | ||
export interface ComputerUseToolParameters { | ||
displayHeight: number; | ||
displayWidth: number; | ||
environment: ComputerUseEnvironment; | ||
} | ||
|
||
// @public | ||
export interface ConnectedAgentDetails { | ||
description: string; | ||
|
@@ -314,6 +360,12 @@ export type ContinuablePage<TElement, TPage = TElement[]> = TPage & { | |
continuationToken?: string; | ||
}; | ||
|
||
// @public | ||
export interface CoordinatePoint { | ||
x: number; | ||
y: number; | ||
} | ||
|
||
// @public | ||
export interface CreateAgentOptionalParams extends OperationOptions { | ||
description?: string | null; | ||
|
@@ -372,6 +424,19 @@ export enum DoneEvent { | |
Done = "done" | ||
} | ||
|
||
// @public | ||
export interface DoubleClickAction extends ComputerUseAction { | ||
type: "double_click"; | ||
x: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not |
||
y: number; | ||
} | ||
|
||
// @public | ||
export interface DragAction extends ComputerUseAction { | ||
path: CoordinatePoint[]; | ||
type: "drag"; | ||
} | ||
|
||
// @public | ||
export enum ErrorEvent { | ||
Error = "error" | ||
|
@@ -522,6 +587,12 @@ export function isOutputOfType<T extends { | |
type: string; | ||
}>(output: RequiredAction | RequiredToolCall | ToolDefinitionUnion, type: string): output is T; | ||
|
||
// @public | ||
export interface KeyPressAction extends ComputerUseAction { | ||
keys: string[]; | ||
type: "keypress"; | ||
} | ||
|
||
// @public | ||
export enum KnownVersions { | ||
V1 = "v1", | ||
|
@@ -890,6 +961,16 @@ export interface MicrosoftFabricToolDefinition extends ToolDefinition { | |
type: "fabric_dataagent"; | ||
} | ||
|
||
// @public | ||
export type MouseButton = "left" | "right" | "wheel" | "back" | "forward"; | ||
|
||
// @public | ||
export interface MoveAction extends ComputerUseAction { | ||
type: "move"; | ||
x: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not use |
||
y: number; | ||
} | ||
|
||
// @public | ||
export interface OpenApiAnonymousAuthDetails extends OpenApiAuthDetails { | ||
type: "anonymous"; | ||
|
@@ -985,6 +1066,18 @@ export interface RequiredAction { | |
// @public | ||
export type RequiredActionUnion = SubmitToolOutputsAction | SubmitToolApprovalAction | RequiredAction; | ||
|
||
// @public | ||
export interface RequiredComputerUseToolCall extends RequiredToolCall { | ||
computerUsePreview: RequiredComputerUseToolCallDetails; | ||
type: "computer_use_preview"; | ||
} | ||
|
||
// @public | ||
export interface RequiredComputerUseToolCallDetails { | ||
action: ComputerUseActionUnion; | ||
pendingSafetyChecks: SafetyCheck[]; | ||
} | ||
|
||
// @public | ||
export interface RequiredFunctionToolCall extends RequiredToolCall { | ||
function: RequiredFunctionToolCallDetails; | ||
|
@@ -1012,7 +1105,7 @@ export interface RequiredToolCall { | |
} | ||
|
||
// @public | ||
export type RequiredToolCallUnion = RequiredFunctionToolCall | RequiredMcpToolCall | RequiredToolCall; | ||
export type RequiredToolCallUnion = RequiredFunctionToolCall | RequiredMcpToolCall | RequiredComputerUseToolCall | RequiredToolCall; | ||
|
||
// @public | ||
export type ResponseFormat = "text" | "json_object"; | ||
|
@@ -1091,15 +1184,15 @@ export interface RunsOperations { | |
createThreadAndRun: (assistantId: string, options?: CreateThreadAndRunOptionalParams) => AgentRunResponse; | ||
get: (threadId: string, runId: string, options?: RunsGetRunOptionalParams) => Promise<ThreadRun>; | ||
list: (threadId: string, options?: RunsListRunsOptionalParams) => PagedAsyncIterableIterator<ThreadRun>; | ||
submitToolOutputs: (threadId: string, runId: string, toolOutputs: ToolOutput[], options?: RunsSubmitToolOutputsToRunOptionalParams) => AgentRunResponse; | ||
submitToolOutputs: (threadId: string, runId: string, toolOutputs: StructuredToolOutputUnion[], options?: RunsSubmitToolOutputsToRunOptionalParams) => AgentRunResponse; | ||
update: (threadId: string, runId: string, options?: RunsUpdateRunOptionalParams) => Promise<ThreadRun>; | ||
} | ||
|
||
// @public | ||
export interface RunsSubmitToolOutputsToRunOptionalParams extends OperationOptions { | ||
stream?: boolean | null; | ||
toolApprovals?: ToolApproval[]; | ||
toolOutputs?: ToolOutput[]; | ||
toolOutputs?: StructuredToolOutputUnion[]; | ||
} | ||
|
||
// @public | ||
|
@@ -1205,6 +1298,20 @@ export interface RunStepCompletionUsage { | |
totalTokens: number; | ||
} | ||
|
||
// @public | ||
export interface RunStepComputerUseToolCall extends RunStepToolCall { | ||
computerUsePreview: RunStepComputerUseToolCallDetails; | ||
type: "computer_use_preview"; | ||
} | ||
|
||
// @public | ||
export interface RunStepComputerUseToolCallDetails { | ||
acknowledgedSafetyChecks?: SafetyCheck[]; | ||
action: ComputerUseActionUnion; | ||
output: ComputerScreenshot; | ||
pendingSafetyChecks: SafetyCheck[]; | ||
} | ||
|
||
// @public | ||
export interface RunStepConnectedAgent { | ||
agentId?: string; | ||
|
@@ -1301,6 +1408,20 @@ export interface RunStepDeltaCodeInterpreterToolCall extends RunStepDeltaToolCal | |
type: "code_interpreter"; | ||
} | ||
|
||
// @public | ||
export interface RunStepDeltaComputerUseDetails { | ||
acknowledgedSafetyChecks?: SafetyCheck[]; | ||
action?: ComputerUseActionUnion; | ||
output?: ComputerScreenshot; | ||
pendingSafetyChecks?: SafetyCheck[]; | ||
} | ||
|
||
// @public | ||
export interface RunStepDeltaComputerUseToolCall extends RunStepDeltaToolCall { | ||
computerUsePreview?: RunStepDeltaComputerUseDetails; | ||
type: "computer_use_preview"; | ||
} | ||
|
||
// @public | ||
export interface RunStepDeltaConnectedAgentToolCall extends RunStepDeltaToolCall { | ||
connectedAgent: RunStepConnectedAgent; | ||
|
@@ -1408,7 +1529,7 @@ export interface RunStepDeltaToolCallObject extends RunStepDeltaDetail { | |
} | ||
|
||
// @public | ||
export type RunStepDeltaToolCallUnion = RunStepDeltaMcpToolCall | RunStepDeltaOpenAPIToolCall | RunStepDeltaConnectedAgentToolCall | RunStepDeltaFunctionToolCall | RunStepDeltaFileSearchToolCall | RunStepDeltaCodeInterpreterToolCall | RunStepDeltaBingGroundingToolCall | RunStepDeltaCustomBingGroundingToolCall | RunStepDeltaAzureFunctionToolCall | RunStepDeltaDeepResearchToolCall | RunStepDeltaAzureAISearchToolCall | RunStepDeltaMicrosoftFabricToolCall | RunStepDeltaSharepointToolCall | RunStepDeltaToolCall; | ||
export type RunStepDeltaToolCallUnion = RunStepDeltaMcpToolCall | RunStepDeltaOpenAPIToolCall | RunStepDeltaConnectedAgentToolCall | RunStepDeltaFunctionToolCall | RunStepDeltaFileSearchToolCall | RunStepDeltaCodeInterpreterToolCall | RunStepDeltaBingGroundingToolCall | RunStepDeltaCustomBingGroundingToolCall | RunStepDeltaAzureFunctionToolCall | RunStepDeltaDeepResearchToolCall | RunStepDeltaAzureAISearchToolCall | RunStepDeltaComputerUseToolCall | RunStepDeltaMicrosoftFabricToolCall | RunStepDeltaSharepointToolCall | RunStepDeltaToolCall; | ||
|
||
// @public | ||
export interface RunStepDetails { | ||
|
@@ -1553,7 +1674,7 @@ export interface RunStepToolCallDetails extends RunStepDetails { | |
} | ||
|
||
// @public | ||
export type RunStepToolCallUnion = RunStepCodeInterpreterToolCall | RunStepFileSearchToolCall | RunStepBingGroundingToolCall | RunStepAzureAISearchToolCall | RunStepBrowserAutomationToolCall | RunStepMcpToolCall | RunStepSharepointToolCall | RunStepMicrosoftFabricToolCall | RunStepBingCustomSearchToolCall | RunStepAzureFunctionToolCall | RunStepFunctionToolCall | RunStepOpenAPIToolCall | RunStepDeepResearchToolCall | RunStepConnectedAgentToolCall | RunStepToolCall; | ||
export type RunStepToolCallUnion = RunStepCodeInterpreterToolCall | RunStepFileSearchToolCall | RunStepBingGroundingToolCall | RunStepAzureAISearchToolCall | RunStepBrowserAutomationToolCall | RunStepMcpToolCall | RunStepComputerUseToolCall | RunStepSharepointToolCall | RunStepMicrosoftFabricToolCall | RunStepBingCustomSearchToolCall | RunStepAzureFunctionToolCall | RunStepFunctionToolCall | RunStepOpenAPIToolCall | RunStepDeepResearchToolCall | RunStepConnectedAgentToolCall | RunStepToolCall; | ||
|
||
// @public | ||
export type RunStepType = "message_creation" | "tool_calls" | "activities"; | ||
|
@@ -1577,6 +1698,27 @@ export interface RunsUpdateRunOptionalParams extends OperationOptions { | |
metadata?: Record<string, string> | null; | ||
} | ||
|
||
// @public | ||
export interface SafetyCheck { | ||
code?: string; | ||
id: string; | ||
message?: string; | ||
} | ||
|
||
// @public | ||
export interface ScreenshotAction extends ComputerUseAction { | ||
type: "screenshot"; | ||
} | ||
|
||
// @public | ||
export interface ScrollAction extends ComputerUseAction { | ||
scrollX: number; | ||
scrollY: number; | ||
type: "scroll"; | ||
x: number; | ||
y: number; | ||
} | ||
|
||
// @public | ||
export interface SharepointGroundingToolParameters { | ||
connectionList?: ToolConnection[]; | ||
|
@@ -1588,6 +1730,15 @@ export interface SharepointToolDefinition extends ToolDefinition { | |
type: "sharepoint_grounding"; | ||
} | ||
|
||
// @public | ||
export interface StructuredToolOutput { | ||
toolCallId?: string; | ||
type: string; | ||
} | ||
|
||
// @public | ||
export type StructuredToolOutputUnion = ToolOutput | ComputerToolOutput | StructuredToolOutput; | ||
|
||
// @public | ||
export interface SubmitToolApprovalAction extends RequiredAction { | ||
submitToolApproval: SubmitToolApprovalDetails; | ||
|
@@ -1736,12 +1887,12 @@ export interface ToolDefinition { | |
} | ||
|
||
// @public | ||
export type ToolDefinitionUnion = CodeInterpreterToolDefinition | FileSearchToolDefinition | FunctionToolDefinition | BingGroundingToolDefinition | MicrosoftFabricToolDefinition | SharepointToolDefinition | AzureAISearchToolDefinition | OpenApiToolDefinition | BingCustomSearchToolDefinition | ConnectedAgentToolDefinition | DeepResearchToolDefinition | MCPToolDefinition | AzureFunctionToolDefinition | BrowserAutomationToolDefinition | ToolDefinition; | ||
export type ToolDefinitionUnion = CodeInterpreterToolDefinition | FileSearchToolDefinition | FunctionToolDefinition | BingGroundingToolDefinition | MicrosoftFabricToolDefinition | SharepointToolDefinition | AzureAISearchToolDefinition | OpenApiToolDefinition | BingCustomSearchToolDefinition | ConnectedAgentToolDefinition | DeepResearchToolDefinition | MCPToolDefinition | ComputerUseToolDefinition | AzureFunctionToolDefinition | BrowserAutomationToolDefinition | ToolDefinition; | ||
|
||
// @public | ||
export interface ToolOutput { | ||
export interface ToolOutput extends StructuredToolOutput { | ||
output?: string; | ||
toolCallId?: string; | ||
type: "function_call_output"; | ||
} | ||
|
||
// @public | ||
|
@@ -1806,6 +1957,10 @@ export class ToolUtility { | |
definition: CodeInterpreterToolDefinition; | ||
resources: ToolResources; | ||
}; | ||
// (undocumented) | ||
static createComputerUseTool(displayWidth: number, displayHeight: number, env: ComputerUseEnvironment): { | ||
definition: ComputerUseToolDefinition; | ||
}; | ||
static createConnectedAgentTool(id: string, name: string, description: string): { | ||
definition: ConnectedAgentToolDefinition; | ||
}; | ||
|
@@ -1838,6 +1993,12 @@ export interface TruncationObject { | |
// @public | ||
export type TruncationStrategy = "auto" | "last_messages"; | ||
|
||
// @public | ||
export interface TypeAction extends ComputerUseAction { | ||
text: string; | ||
type: "type"; | ||
} | ||
|
||
// @public | ||
export interface UpdateAgentOptionalParams extends OperationOptions { | ||
description?: string | null; | ||
|
@@ -2126,6 +2287,11 @@ export interface VectorStoreStaticChunkingStrategyResponse extends VectorStoreCh | |
// @public | ||
export type VectorStoreStatus = "expired" | "in_progress" | "completed"; | ||
|
||
// @public | ||
export interface WaitAction extends ComputerUseAction { | ||
type: "wait"; | ||
} | ||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use
kind
for these types of discriminators in TS - is this autogenerated or hand authored?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is generated