Class: OpenAIAgentWorker
Implements
Constructors
constructor
• new OpenAIAgentWorker(«destructured»
): OpenAIAgentWorker
Parameters
Name | Type |
---|---|
«destructured» | OpenAIAgentWorkerParams |
Returns
Defined in
packages/core/src/agent/openai/worker.ts:92
Properties
_getTools
• Private
_getTools: (input
: string
) => Promise
<BaseTool
<any
>[]>
Type declaration
▸ (input
): Promise
<BaseTool
<any
>[]>
Parameters
Name | Type |
---|---|
input | string |
Returns
Promise
<BaseTool
<any
>[]>
Defined in
packages/core/src/agent/openai/worker.ts:90
llm
• Private
llm: OpenAI
Defined in
packages/core/src/agent/openai/worker.ts:85
maxFunctionCalls
• Private
maxFunctionCalls: number
= 5
Defined in
packages/core/src/agent/openai/worker.ts:86
prefixMessages
• prefixMessages: ChatMessage
[]
Defined in
packages/core/src/agent/openai/worker.ts:88
Methods
_getAgentResponse
▸ _getAgentResponse(task
, mode
, llmChatParams
): Promise
<AgentChatResponse
| StreamingAgentChatResponse
>
Parameters
Name | Type |
---|---|
task | Task |
mode | ChatResponseMode |
llmChatParams | LLMChatParamsBase <OpenAIAdditionalChatOptions , ToolCallLLMMessageOptions > |
Returns
Promise
<AgentChatResponse
| StreamingAgentChatResponse
>
Defined in
packages/core/src/agent/openai/worker.ts:253
_getLlmChatParams
▸ _getLlmChatParams(task
, tools
, toolChoice?
): LLMChatParamsBase
<OpenAIAdditionalChatOptions
, ToolCallLLMMessageOptions
>
Parameters
Name | Type | Default value |
---|---|---|
task | Task | undefined |
tools | BaseTool <any >[] | undefined |
toolChoice | ChatCompletionToolChoiceOption | "auto" |
Returns
LLMChatParamsBase
<OpenAIAdditionalChatOptions
, ToolCallLLMMessageOptions
>
Defined in
packages/core/src/agent/openai/worker.ts:142
_getStreamAiResponse
▸ _getStreamAiResponse(task
, llmChatParams
): Promise
<AgentChatResponse
| StreamingAgentChatResponse
>
Parameters
Name | Type |
---|---|
task | Task |
llmChatParams | LLMChatParamsBase <OpenAIAdditionalChatOptions , ToolCallLLMMessageOptions > |
Returns
Promise
<AgentChatResponse
| StreamingAgentChatResponse
>
Defined in
packages/core/src/agent/openai/worker.ts:176
_processMessage
▸ _processMessage(task
, aiMessage
): AgentChatResponse
Parameters
Name | Type |
---|---|
task | Task |
aiMessage | ChatMessage |
Returns
Defined in
packages/core/src/agent/openai/worker.ts:164
_runStep
▸ _runStep(step
, task
, mode?
, toolChoice?
): Promise
<TaskStepOutput
>
Parameters
Name | Type | Default value |
---|---|---|
step | TaskStep | undefined |
task | Task | undefined |
mode | ChatResponseMode | ChatResponseMode.WAIT |
toolChoice | ChatCompletionToolChoiceOption | "auto" |
Returns
Promise
<TaskStepOutput
>
Defined in
packages/core/src/agent/openai/worker.ts:329