Skip to content

Commit 2b9733b

Browse files
committed
refactor: remove unused function call output type and simplify response output message type
1 parent 4fc0fa0 commit 2b9733b

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

src/routes/messages/responses-translation.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
type ResponsesResult,
1111
type ResponseOutputContentBlock,
1212
type ResponseOutputFunctionCall,
13-
type ResponseOutputFunctionCallOutput,
1413
type ResponseOutputItem,
1514
type ResponseOutputReasoning,
1615
type ResponseReasoningBlock,
@@ -388,15 +387,7 @@ const mapOutputToAnthropicContent = (
388387
}
389388
break
390389
}
391-
case "function_call_output": {
392-
const outputBlock = createFunctionCallOutputBlock(item)
393-
if (outputBlock) {
394-
contentBlocks.push(outputBlock)
395-
}
396-
break
397-
}
398-
case "message":
399-
case "output_text": {
390+
case "message": {
400391
const combinedText = combineMessageTextContent(item.content)
401392
if (combinedText.length > 0) {
402393
contentBlocks.push({ type: "text", text: combinedText })
@@ -511,19 +502,6 @@ const createToolUseContentBlock = (
511502
}
512503
}
513504

514-
const createFunctionCallOutputBlock = (
515-
output: ResponseOutputFunctionCallOutput,
516-
): AnthropicAssistantContentBlock | null => {
517-
if (typeof output.output !== "string" || output.output.length === 0) {
518-
return null
519-
}
520-
521-
return {
522-
type: "text",
523-
text: output.output,
524-
}
525-
}
526-
527505
const parseFunctionCallArguments = (
528506
rawArguments: string,
529507
): Record<string, unknown> => {

src/services/copilot/create-responses.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ export type ResponseOutputItem =
9595
| ResponseOutputMessage
9696
| ResponseOutputReasoning
9797
| ResponseOutputFunctionCall
98-
| ResponseOutputFunctionCallOutput
9998

10099
export interface ResponseOutputMessage {
101100
id: string
102-
type: "message" | "output_text"
101+
type: "message"
103102
role: "assistant"
104103
status: "completed" | "in_progress" | "incomplete"
105104
content?: Array<ResponseOutputContentBlock>
@@ -131,15 +130,6 @@ export interface ResponseOutputFunctionCall {
131130
[key: string]: unknown
132131
}
133132

134-
export interface ResponseOutputFunctionCallOutput {
135-
id: string
136-
type: "function_call_output"
137-
call_id: string
138-
output: string
139-
status?: "in_progress" | "completed" | "incomplete"
140-
[key: string]: unknown
141-
}
142-
143133
export type ResponseOutputContentBlock =
144134
| ResponseOutputText
145135
| ResponseOutputRefusal

0 commit comments

Comments
 (0)