akanjs 3.1.0-rc.19 → 3.1.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "3.1.0-rc.19",
3
+ "version": "3.1.0-rc.20",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -79,7 +79,7 @@ export class AnthropicLlm
79
79
  }
80
80
 
81
81
  async chat(request: LlmTurnRequest, onDelta?: (delta: string) => void): Promise<LlmTurnAnswer | null> {
82
- const model = this.llmOption.model;
82
+ const model = request.model || this.llmOption.model;
83
83
  if (!this.llmOption.apiKey || !model) {
84
84
  this.logger.warn(
85
85
  "AnthropicLlm needs both apiKey and model — set them with option.setLlm(). Agent turns are unavailable.",
@@ -70,6 +70,11 @@ export interface LlmTurnRequest {
70
70
  tools: AgentWireTool[];
71
71
  context: AgentWireContext[];
72
72
  instructions?: string;
73
+ /**
74
+ * This turn's model in place of `LlmOption.model`. `accepts`, `maxTokens` and `contextWindow` stay the option's, so a
75
+ * model that differs in them needs an adaptor of its own. Set by server code only: `runAgentTurn` takes no model.
76
+ */
77
+ model?: string;
73
78
  }
74
79
 
75
80
  export interface LlmTurnAnswer {
@@ -31,7 +31,7 @@ export class OpenaiLlm
31
31
  }
32
32
 
33
33
  async chat(request: LlmTurnRequest, onDelta?: (delta: string) => void): Promise<LlmTurnAnswer | null> {
34
- const model = this.llmOption.model;
34
+ const model = request.model || this.llmOption.model;
35
35
  if (!this.llmOption.apiKey || !model) {
36
36
  this.logger.warn(
37
37
  "OpenaiLlm needs both apiKey and model — set them with option.setLlm(). Agent turns are unavailable.",
@@ -63,6 +63,11 @@ export interface LlmTurnRequest {
63
63
  tools: AgentWireTool[];
64
64
  context: AgentWireContext[];
65
65
  instructions?: string;
66
+ /**
67
+ * This turn's model in place of `LlmOption.model`. `accepts`, `maxTokens` and `contextWindow` stay the option's, so a
68
+ * model that differs in them needs an adaptor of its own. Set by server code only: `runAgentTurn` takes no model.
69
+ */
70
+ model?: string;
66
71
  }
67
72
  export interface LlmTurnAnswer {
68
73
  text?: string;