Travis Fischer 2023-06-06 12:52:18 -07:00
rodzic 3c27840337
commit b15d245137
3 zmienionych plików z 18 dodań i 6 usunięć

Wyświetl plik

@ -56,12 +56,12 @@ export class Agentic {
new HumanFeedbackMechanismCLI({ agentic: this }) new HumanFeedbackMechanismCLI({ agentic: this })
} }
public get openai(): types.openai.OpenAIClient { public get openai(): types.openai.OpenAIClient | undefined {
return this._openai! return this._openai
} }
public get anthropic(): types.anthropic.Client { public get anthropic(): types.anthropic.Client | undefined {
return this._anthropic! return this._anthropic
} }
public get defaultHumanFeedbackMechamism() { public get defaultHumanFeedbackMechamism() {

Wyświetl plik

@ -38,7 +38,13 @@ export class AnthropicChatModel<
...options ...options
}) })
this._client = this._agentic.anthropic if (this._agentic.anthropic) {
this._client = this._agentic.anthropic
} else {
throw new Error(
'AnthropicChatModel requires an Anthropic client to be configured on the Agentic runtime'
)
}
} }
protected override async _createChatCompletion( protected override async _createChatCompletion(

Wyświetl plik

@ -29,7 +29,13 @@ export class OpenAIChatModel<
...options ...options
}) })
this._client = this._agentic.openai if (this._agentic.openai) {
this._client = this._agentic.openai
} else {
throw new Error(
'OpenAIChatModel requires an OpenAI client to be configured on the Agentic runtime'
)
}
} }
protected override async _createChatCompletion( protected override async _createChatCompletion(