mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
docstring
This commit is contained in:
@@ -500,7 +500,7 @@ mod tests {
|
||||
|
||||
/// Validate that `stream_chat_completions` converts our internal `Prompt` into the exact
|
||||
/// Chat Completions JSON payload expected by OpenAI. We build a prompt containing user
|
||||
////assistant turns, a function call and its output, issue the request against a
|
||||
/// assistant turns, a function call and its output, issue the request against a
|
||||
/// `wiremock::MockServer`, capture the JSON body, and assert that the full `messages` array
|
||||
/// matches a golden value. The test is a pure unit-test; it is skipped automatically when
|
||||
/// the sandbox disables networking.
|
||||
|
||||
@@ -207,6 +207,9 @@ mod tests {
|
||||
assert_eq!(dummy, &expected_dummy);
|
||||
}
|
||||
|
||||
/// When the model name starts with `codex-`, the built-in shell tool should be encoded
|
||||
/// as `local_shell` rather than `shell`. Verify that the first tool in the JSON list has
|
||||
/// the adjusted type in that scenario.
|
||||
#[test]
|
||||
fn responses_codex_model_uses_local_shell() {
|
||||
let mut prompt = Prompt::default();
|
||||
@@ -217,6 +220,9 @@ mod tests {
|
||||
assert_eq!(tools[0]["type"], "local_shell");
|
||||
}
|
||||
|
||||
/// Chat-Completions API expects the V2 tool schema (`{"type":"function","function":{..}}`).
|
||||
/// Confirm that every entry is shaped accordingly and the wrapper does not leak the internal
|
||||
/// `type` field inside the nested `function` object.
|
||||
#[test]
|
||||
fn chat_completions_tool_format() {
|
||||
let mut prompt = Prompt::default();
|
||||
|
||||
Reference in New Issue
Block a user