Skip to content

Commit b1d8b31

Browse files
committed
Revert "include tool call ids"
This reverts commit 8c63e6a.
1 parent 8c63e6a commit b1d8b31

11 files changed

Lines changed: 2 additions & 73 deletions

packages/internal/src/openai-compatible/chat/convert-to-openai-compatible-chat-messages.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ describe('tool calls', () => {
147147
{
148148
role: 'tool',
149149
content: JSON.stringify({ oof: '321rab' }),
150-
name: 'thwomp',
151150
tool_call_id: 'quux',
152151
},
153152
])
@@ -197,7 +196,6 @@ describe('tool calls', () => {
197196
{
198197
role: 'tool',
199198
content: 'It is sunny today',
200-
name: 'getWeather',
201199
tool_call_id: 'call-1',
202200
},
203201
])
@@ -543,13 +541,11 @@ describe('provider-specific metadata merging', () => {
543541
{
544542
role: 'tool',
545543
tool_call_id: 'call123',
546-
name: 'calculator',
547544
content: JSON.stringify({ stepOne: 'data chunk 1' }),
548545
},
549546
{
550547
role: 'tool',
551548
tool_call_id: 'call123',
552-
name: 'calculator',
553549
content: JSON.stringify({ stepTwo: 'data chunk 2' }),
554550
partial: true,
555551
},

packages/internal/src/openai-compatible/chat/convert-to-openai-compatible-chat-messages.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ export function convertToOpenAICompatibleChatMessages(
124124
messages.push({
125125
role: 'tool',
126126
tool_call_id: toolResponse.toolCallId,
127-
name: toolResponse.toolName,
128127
content: contentValue,
129128
...toolResponseMetadata,
130129
})

packages/internal/src/openai-compatible/chat/openai-compatible-api-types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,5 @@ export interface OpenAICompatibleMessageToolCall extends JsonRecord {
5959
export interface OpenAICompatibleToolMessage extends JsonRecord {
6060
role: 'tool';
6161
content: string;
62-
name?: string;
6362
tool_call_id: string;
6463
}

packages/internal/src/openai-compatible/chat/openai-compatible-prepare-tools.test.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/internal/src/openai-compatible/chat/openai-compatible-prepare-tools.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export function prepareTools({
1616
tools:
1717
| undefined
1818
| Array<{
19-
id: string;
2019
type: 'function';
2120
function: {
2221
name: string;
@@ -42,7 +41,6 @@ export function prepareTools({
4241
}
4342

4443
const openaiCompatTools: Array<{
45-
id: string;
4644
type: 'function';
4745
function: {
4846
name: string;
@@ -51,12 +49,11 @@ export function prepareTools({
5149
};
5250
}> = [];
5351

54-
for (const [index, tool] of tools.entries()) {
52+
for (const tool of tools) {
5553
if (tool.type === 'provider-defined') {
5654
toolWarnings.push({ type: 'unsupported-tool', tool });
5755
} else {
5856
openaiCompatTools.push({
59-
id: `tool_${index + 1}`,
6057
type: 'function',
6158
function: {
6259
name: tool.name,

packages/internal/src/openrouter-ai-sdk/chat/convert-to-openrouter-chat-messages.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ describe('cache control', () => {
481481
{
482482
role: 'tool',
483483
tool_call_id: 'call-123',
484-
name: 'calculator',
485484
content: JSON.stringify({ answer: 42 }),
486485
cache_control: { type: 'ephemeral' },
487486
},

packages/internal/src/openrouter-ai-sdk/chat/convert-to-openrouter-chat-messages.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ export function convertToOpenRouterChatMessages(
198198
messages.push({
199199
role: 'tool',
200200
tool_call_id: toolResponse.toolCallId,
201-
name: toolResponse.toolName,
202201
content,
203202
cache_control:
204203
getCacheControl(providerOptions) ??

packages/internal/src/openrouter-ai-sdk/chat/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ describe('doGenerate', () => {
629629
messages: [{ role: 'user', content: [{ type: 'text', text: 'Hello' }] }],
630630
tools: [
631631
{
632-
id: 'tool_1',
633632
type: 'function',
634633
function: {
635634
name: 'test-tool',

packages/internal/src/openrouter-ai-sdk/chat/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ export class OpenRouterChatLanguageModel implements LanguageModelV2 {
166166
// TODO: support built-in tools
167167
const mappedTools = tools
168168
.filter((tool) => tool.type === 'function')
169-
.map((tool, index) => ({
170-
id: `tool_${index + 1}`,
169+
.map((tool) => ({
171170
type: 'function' as const,
172171
function: {
173172
name: tool.name,

packages/internal/src/openrouter-ai-sdk/types/openrouter-chat-completions-input.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export interface ChatCompletionMessageToolCall {
7373
export interface ChatCompletionToolMessageParam {
7474
role: 'tool'
7575
content: string
76-
name?: string
7776
tool_call_id: string
7877
cache_control?: OpenRouterCacheControl
7978
}

0 commit comments

Comments
 (0)