mirror of
https://github.com/openai/codex.git
synced 2026-05-06 06:12:59 +03:00
V1
This commit is contained in:
46
codex-rs/api-client/src/prompt.rs
Normal file
46
codex-rs/api-client/src/prompt.rs
Normal file
@@ -0,0 +1,46 @@
|
||||
use codex_protocol::models::ResponseItem;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::Reasoning;
|
||||
use crate::TextControls;
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct Prompt {
|
||||
pub instructions: String,
|
||||
pub input: Vec<ResponseItem>,
|
||||
pub tools: Vec<Value>,
|
||||
pub parallel_tool_calls: bool,
|
||||
pub output_schema: Option<Value>,
|
||||
pub reasoning: Option<Reasoning>,
|
||||
pub text_controls: Option<TextControls>,
|
||||
pub prompt_cache_key: Option<String>,
|
||||
pub session_source: Option<SessionSource>,
|
||||
}
|
||||
|
||||
impl Prompt {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
instructions: String,
|
||||
input: Vec<ResponseItem>,
|
||||
tools: Vec<Value>,
|
||||
parallel_tool_calls: bool,
|
||||
output_schema: Option<Value>,
|
||||
reasoning: Option<Reasoning>,
|
||||
text_controls: Option<TextControls>,
|
||||
prompt_cache_key: Option<String>,
|
||||
session_source: Option<SessionSource>,
|
||||
) -> Self {
|
||||
Self {
|
||||
instructions,
|
||||
input,
|
||||
tools,
|
||||
parallel_tool_calls,
|
||||
output_schema,
|
||||
reasoning,
|
||||
text_controls,
|
||||
prompt_cache_key,
|
||||
session_source,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user