Skip to content

Commit e2f3ceb

Browse files
committed
fix types
1 parent 46dfb69 commit e2f3ceb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/funcs/callModel.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { OpenRouterCore } from '../core.js';
22
import type { RequestOptions } from '../lib/sdks.js';
3-
import type { EnhancedTool, MaxToolRounds } from '../lib/tool-types.js';
3+
import type { Tool, MaxToolRounds } from '../lib/tool-types.js';
44
import type * as models from '../models/index.js';
55

66
import { ResponseWrapper } from '../lib/response-wrapper.js';
7-
import { convertEnhancedToolsToAPIFormat } from '../lib/tool-executor.js';
7+
import { convertToolsToAPIFormat } from '../lib/tool-executor.js';
88

99
/**
1010
* Input type that accepts both chat-style messages and responses-style input
@@ -15,7 +15,7 @@ export type CallModelInput = models.OpenResponsesInput | models.Message[];
1515
* Tool type that accepts chat-style, responses-style, or enhanced tools
1616
*/
1717
export type CallModelTools =
18-
| EnhancedTool[]
18+
| Tool[]
1919
| models.ToolDefinitionJson[]
2020
| models.OpenResponsesRequest['tools'];
2121

@@ -233,12 +233,12 @@ export function callModel(
233233
isChatTools = !isEnhancedTools && isChatStyleTools(tools);
234234
}
235235

236-
const enhancedTools = isEnhancedTools ? (tools as EnhancedTool[]) : undefined;
236+
const enhancedTools = isEnhancedTools ? (tools as Tool[]) : undefined;
237237

238238
// Convert tools to API format based on their type
239239
let apiTools: models.OpenResponsesRequest['tools'];
240240
if (enhancedTools) {
241-
apiTools = convertEnhancedToolsToAPIFormat(enhancedTools);
241+
apiTools = convertToolsToAPIFormat(enhancedTools);
242242
} else if (isChatTools) {
243243
apiTools = convertChatToResponsesTools(tools as models.ToolDefinitionJson[]);
244244
} else {
@@ -257,7 +257,7 @@ export function callModel(
257257
client: OpenRouterCore;
258258
request: models.OpenResponsesRequest;
259259
options: RequestOptions;
260-
tools?: EnhancedTool[];
260+
tools?: Tool[];
261261
maxToolRounds?: MaxToolRounds;
262262
} = {
263263
client,

src/lib/response-wrapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { RequestOptions } from './sdks.js';
55
import type {
66
ChatStreamEvent,
77
EnhancedResponseStreamEvent,
8-
EnhancedTool,
8+
Tool,
99
MaxToolRounds,
1010
ParsedToolCall,
1111
ToolStreamEvent,
@@ -32,7 +32,7 @@ export interface GetResponseOptions {
3232
request: models.OpenResponsesRequest;
3333
client: OpenRouterCore;
3434
options?: RequestOptions;
35-
tools?: EnhancedTool[];
35+
tools?: Tool[];
3636
maxToolRounds?: MaxToolRounds;
3737
}
3838

src/lib/tool-orchestrator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type * as models from '../models/index.js';
2-
import type { APITool, EnhancedTool, ToolExecutionResult } from './tool-types.js';
2+
import type { APITool, Tool, ToolExecutionResult } from './tool-types.js';
33

44
import { extractToolCallsFromResponse, responseHasToolCalls } from './stream-transformers.js';
55
import { executeTool, findToolByName } from './tool-executor.js';
@@ -40,7 +40,7 @@ export async function executeToolLoop(
4040
tools: APITool[],
4141
) => Promise<models.OpenResponsesNonStreamingResponse>,
4242
initialInput: models.OpenResponsesInput,
43-
tools: EnhancedTool[],
43+
tools: Tool[],
4444
apiTools: APITool[],
4545
options: ToolExecutionOptions = {},
4646
): Promise<ToolOrchestrationResult> {

0 commit comments

Comments
 (0)