Skip to content

Commit f884292

Browse files
committed
Add original-resolution view_image support
git-stack-id: fjord/original_image_res---4hw7wu3447irye git-stack-title: Add original-resolution view_image support
1 parent 3b5996f commit f884292

File tree

23 files changed

+684
-49
lines changed

23 files changed

+684
-49
lines changed

codex-rs/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/json/ClientRequest.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,16 @@
514514
},
515515
{
516516
"properties": {
517+
"detail": {
518+
"anyOf": [
519+
{
520+
"$ref": "#/definitions/ImageDetail"
521+
},
522+
{
523+
"type": "null"
524+
}
525+
]
526+
},
517527
"image_url": {
518528
"type": "string"
519529
},
@@ -627,6 +637,15 @@
627637
],
628638
"type": "string"
629639
},
640+
"ImageDetail": {
641+
"enum": [
642+
"auto",
643+
"low",
644+
"high",
645+
"original"
646+
],
647+
"type": "string"
648+
},
630649
"InitializeCapabilities": {
631650
"description": "Client-declared capabilities negotiated during initialize.",
632651
"properties": {

codex-rs/app-server-protocol/schema/json/EventMsg.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,6 +3468,16 @@
34683468
},
34693469
{
34703470
"properties": {
3471+
"detail": {
3472+
"anyOf": [
3473+
{
3474+
"$ref": "#/definitions/ImageDetail"
3475+
},
3476+
{
3477+
"type": "null"
3478+
}
3479+
]
3480+
},
34713481
"image_url": {
34723482
"type": "string"
34733483
},
@@ -3559,6 +3569,15 @@
35593569
],
35603570
"type": "object"
35613571
},
3572+
"ImageDetail": {
3573+
"enum": [
3574+
"auto",
3575+
"low",
3576+
"high",
3577+
"original"
3578+
],
3579+
"type": "string"
3580+
},
35623581
"LocalShellAction": {
35633582
"oneOf": [
35643583
{

codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9537,6 +9537,16 @@
95379537
},
95389538
{
95399539
"properties": {
9540+
"detail": {
9541+
"anyOf": [
9542+
{
9543+
"$ref": "#/definitions/v2/ImageDetail"
9544+
},
9545+
{
9546+
"type": "null"
9547+
}
9548+
]
9549+
},
95409550
"image_url": {
95419551
"type": "string"
95429552
},
@@ -9702,6 +9712,15 @@
97029712
],
97039713
"type": "string"
97049714
},
9715+
"ImageDetail": {
9716+
"enum": [
9717+
"auto",
9718+
"low",
9719+
"high",
9720+
"original"
9721+
],
9722+
"type": "string"
9723+
},
97059724
"InputModality": {
97069725
"description": "Canonical user-input modality tags advertised by a model.",
97079726
"oneOf": [

codex-rs/app-server-protocol/schema/json/v2/RawResponseItemCompletedNotification.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@
103103
},
104104
{
105105
"properties": {
106+
"detail": {
107+
"anyOf": [
108+
{
109+
"$ref": "#/definitions/ImageDetail"
110+
},
111+
{
112+
"type": "null"
113+
}
114+
]
115+
},
106116
"image_url": {
107117
"type": "string"
108118
},
@@ -173,6 +183,15 @@
173183
],
174184
"type": "object"
175185
},
186+
"ImageDetail": {
187+
"enum": [
188+
"auto",
189+
"low",
190+
"high",
191+
"original"
192+
],
193+
"type": "string"
194+
},
176195
"LocalShellAction": {
177196
"oneOf": [
178197
{

codex-rs/app-server-protocol/schema/json/v2/ThreadResumeParams.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@
145145
},
146146
{
147147
"properties": {
148+
"detail": {
149+
"anyOf": [
150+
{
151+
"$ref": "#/definitions/ImageDetail"
152+
},
153+
{
154+
"type": "null"
155+
}
156+
]
157+
},
148158
"image_url": {
149159
"type": "string"
150160
},
@@ -215,6 +225,15 @@
215225
],
216226
"type": "object"
217227
},
228+
"ImageDetail": {
229+
"enum": [
230+
"auto",
231+
"low",
232+
"high",
233+
"original"
234+
],
235+
"type": "string"
236+
},
218237
"LocalShellAction": {
219238
"oneOf": [
220239
{
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// GENERATED CODE! DO NOT MODIFY BY HAND!
22

33
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4+
import type { ImageDetail } from "./ImageDetail";
45

56
/**
67
* Responses API compatible content items that can be returned by a tool call.
78
* This is a subset of ContentItem with the types we support as function call outputs.
89
*/
9-
export type FunctionCallOutputContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, };
10+
export type FunctionCallOutputContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, };
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// GENERATED CODE! DO NOT MODIFY BY HAND!
2+
3+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4+
5+
export type ImageDetail = "auto" | "low" | "high" | "original";

codex-rs/app-server-protocol/schema/typescript/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export type { GitDiffToRemoteParams } from "./GitDiffToRemoteParams";
9696
export type { GitDiffToRemoteResponse } from "./GitDiffToRemoteResponse";
9797
export type { GitSha } from "./GitSha";
9898
export type { HistoryEntry } from "./HistoryEntry";
99+
export type { ImageDetail } from "./ImageDetail";
99100
export type { InitializeCapabilities } from "./InitializeCapabilities";
100101
export type { InitializeParams } from "./InitializeParams";
101102
export type { InitializeResponse } from "./InitializeResponse";

codex-rs/app-server/tests/suite/v2/dynamic_tools.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ async fn dynamic_tool_call_round_trip_sends_content_items_to_model() -> Result<(
399399
FunctionCallOutputContentItem::InputText { text }
400400
}
401401
DynamicToolCallOutputContentItem::InputImage { image_url } => {
402-
FunctionCallOutputContentItem::InputImage { image_url }
402+
FunctionCallOutputContentItem::InputImage {
403+
image_url,
404+
detail: None,
405+
}
403406
}
404407
})
405408
.collect::<Vec<FunctionCallOutputContentItem>>();

0 commit comments

Comments
 (0)