[app-server] Add ImageView item (#7468)
Add view_image tool call as image_view item.
Before:
```
< {
< "method": "codex/event/view_image_tool_call",
< "params": {
< "conversationId": "019adc2f-2922-7e43-ace9-64f394019616",
< "id": "0",
< "msg": {
< "call_id": "call_nBQDxnTfZQtgjGpVoGuDnRjz",
< "path": "/Users/celia/code/codex/codex-rs/app-server-protocol/codex-cli-login.png",
< "type": "view_image_tool_call"
< }
< }
< }
```
After:
```
< {
< "method": "item/started",
< "params": {
< "item": {
< "id": "call_nBQDxnTfZQtgjGpVoGuDnRjz",
< "path": "/Users/celia/code/codex/codex-rs/app-server-protocol/codex-cli-login.png",
< "type": "imageView"
< },
< "threadId": "019adc2f-2922-7e43-ace9-64f394019616",
< "turnId": "0"
< }
< }
< {
< "method": "item/completed",
< "params": {
< "item": {
< "id": "call_nBQDxnTfZQtgjGpVoGuDnRjz",
< "path": "/Users/celia/code/codex/codex-rs/app-server-protocol/codex-cli-login.png",
< "type": "imageView"
< },
< "threadId": "019adc2f-2922-7e43-ace9-64f394019616",
< "turnId": "0"
< }
< }
```
This commit is contained in:
parent
5b25915d7e
commit
ff4ca9959c
1 changed files with 22 additions and 0 deletions
|
|
@ -351,6 +351,28 @@ pub(crate) async fn apply_bespoke_event_handling(
|
|||
}))
|
||||
.await;
|
||||
}
|
||||
EventMsg::ViewImageToolCall(view_image_event) => {
|
||||
let item = ThreadItem::ImageView {
|
||||
id: view_image_event.call_id.clone(),
|
||||
path: view_image_event.path.to_string_lossy().into_owned(),
|
||||
};
|
||||
let started = ItemStartedNotification {
|
||||
thread_id: conversation_id.to_string(),
|
||||
turn_id: event_turn_id.clone(),
|
||||
item: item.clone(),
|
||||
};
|
||||
outgoing
|
||||
.send_server_notification(ServerNotification::ItemStarted(started))
|
||||
.await;
|
||||
let completed = ItemCompletedNotification {
|
||||
thread_id: conversation_id.to_string(),
|
||||
turn_id: event_turn_id.clone(),
|
||||
item,
|
||||
};
|
||||
outgoing
|
||||
.send_server_notification(ServerNotification::ItemCompleted(completed))
|
||||
.await;
|
||||
}
|
||||
EventMsg::EnteredReviewMode(review_request) => {
|
||||
let review = review_request.user_facing_hint;
|
||||
let item = ThreadItem::EnteredReviewMode {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue