mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
V6
This commit is contained in:
@@ -58,7 +58,7 @@ pub(crate) async fn stream_chat_completions(
|
||||
ResponseItem::Message { role, .. } => last_emitted_role = Some(role.as_str()),
|
||||
ResponseItem::FunctionCall { .. }
|
||||
| ResponseItem::LocalShellCall { .. }
|
||||
| ResponseItem::IShell { .. } => last_emitted_role = Some("assistant"),
|
||||
| ResponseItem::UnifiedExec { .. } => last_emitted_role = Some("assistant"),
|
||||
ResponseItem::FunctionCallOutput { .. } => last_emitted_role = Some("tool"),
|
||||
ResponseItem::Reasoning { .. } | ResponseItem::Other => {}
|
||||
ResponseItem::CustomToolCall { .. } => {}
|
||||
@@ -121,7 +121,7 @@ pub(crate) async fn stream_chat_completions(
|
||||
match &input[idx + 1] {
|
||||
ResponseItem::FunctionCall { .. }
|
||||
| ResponseItem::LocalShellCall { .. }
|
||||
| ResponseItem::IShell { .. } => {
|
||||
| ResponseItem::UnifiedExec { .. } => {
|
||||
reasoning_by_anchor_index
|
||||
.entry(idx + 1)
|
||||
.and_modify(|v| v.push_str(&text))
|
||||
@@ -226,7 +226,7 @@ pub(crate) async fn stream_chat_completions(
|
||||
}
|
||||
messages.push(msg);
|
||||
}
|
||||
ResponseItem::IShell { .. } => {
|
||||
ResponseItem::UnifiedExec { .. } => {
|
||||
// The interactive shell tool is currently exposed only via the
|
||||
// Responses API. Ignore these items when using Chat
|
||||
// Completions to maintain feature parity with existing
|
||||
|
||||
@@ -1988,7 +1988,7 @@ async fn handle_response_item(
|
||||
.await,
|
||||
)
|
||||
}
|
||||
ResponseItem::IShell {
|
||||
ResponseItem::UnifiedExec {
|
||||
id,
|
||||
session_id,
|
||||
arguments,
|
||||
|
||||
@@ -71,7 +71,7 @@ fn is_api_message(message: &ResponseItem) -> bool {
|
||||
| ResponseItem::CustomToolCall { .. }
|
||||
| ResponseItem::CustomToolCallOutput { .. }
|
||||
| ResponseItem::LocalShellCall { .. }
|
||||
| ResponseItem::IShell { .. }
|
||||
| ResponseItem::UnifiedExec { .. }
|
||||
| ResponseItem::Reasoning { .. } => true,
|
||||
ResponseItem::WebSearchCall { .. } | ResponseItem::Other => false,
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ pub(crate) fn map_response_item_to_event_messages(
|
||||
ResponseItem::FunctionCall { .. }
|
||||
| ResponseItem::FunctionCallOutput { .. }
|
||||
| ResponseItem::LocalShellCall { .. }
|
||||
| ResponseItem::IShell { .. }
|
||||
| ResponseItem::UnifiedExec { .. }
|
||||
| ResponseItem::CustomToolCall { .. }
|
||||
| ResponseItem::CustomToolCallOutput { .. }
|
||||
| ResponseItem::Other => Vec::new(),
|
||||
|
||||
@@ -7,7 +7,7 @@ pub(crate) fn is_persisted_response_item(item: &ResponseItem) -> bool {
|
||||
ResponseItem::Message { .. }
|
||||
| ResponseItem::Reasoning { .. }
|
||||
| ResponseItem::LocalShellCall { .. }
|
||||
| ResponseItem::IShell { .. }
|
||||
| ResponseItem::UnifiedExec { .. }
|
||||
| ResponseItem::FunctionCall { .. }
|
||||
| ResponseItem::FunctionCallOutput { .. }
|
||||
| ResponseItem::CustomToolCall { .. }
|
||||
|
||||
@@ -114,7 +114,7 @@ pub enum ResponseItem {
|
||||
status: Option<String>,
|
||||
action: WebSearchAction,
|
||||
},
|
||||
IShell {
|
||||
UnifiedExec {
|
||||
#[serde(skip_serializing)]
|
||||
id: Option<String>,
|
||||
/// Identifier for the interactive shell session. When absent, a new
|
||||
|
||||
Reference in New Issue
Block a user