mirror of
https://github.com/openai/codex.git
synced 2026-05-19 10:43:38 +00:00
[codex] Refine Python SDK user-facing docs (#22941)
## Summary - Remove maintainer and release-process wording from the Python SDK README and docs. - Rewrite SDK-facing comments/docstrings so they read as standalone product documentation. - Add a real app-server integration smoke that follows the public quickstart-style `Codex() -> thread_start() -> run()` path. ## Integration coverage - Add `test_real_quickstart_style_flow_smoke` in the real app-server integration suite. ## Validation - Local tests were not run per repo guidance. CI should validate this branch once the PR is online.
This commit is contained in:
@@ -295,6 +295,38 @@ def test_real_thread_run_convenience_smoke(runtime_env: PreparedRuntimeEnv) -> N
|
||||
assert isinstance(data["has_usage"], bool)
|
||||
|
||||
|
||||
def test_real_quickstart_style_flow_smoke(runtime_env: PreparedRuntimeEnv) -> None:
|
||||
data = _run_json_python(
|
||||
runtime_env,
|
||||
textwrap.dedent(
|
||||
"""
|
||||
import json
|
||||
from openai_codex import Codex
|
||||
|
||||
with Codex() as codex:
|
||||
thread = codex.thread_start()
|
||||
result = thread.run("Say hello in one sentence.")
|
||||
print(json.dumps({
|
||||
"thread_id": thread.id,
|
||||
"final_response": result.final_response,
|
||||
"items_count": len(result.items),
|
||||
}))
|
||||
"""
|
||||
),
|
||||
)
|
||||
|
||||
assert {
|
||||
"thread_id_is_text": isinstance(data["thread_id"], str) and bool(data["thread_id"].strip()),
|
||||
"final_response_is_text": isinstance(data["final_response"], str)
|
||||
and bool(data["final_response"].strip()),
|
||||
"items_count_is_int": isinstance(data["items_count"], int),
|
||||
} == {
|
||||
"thread_id_is_text": True,
|
||||
"final_response_is_text": True,
|
||||
"items_count_is_int": True,
|
||||
}
|
||||
|
||||
|
||||
def test_real_async_thread_turn_usage_and_ids_smoke(
|
||||
runtime_env: PreparedRuntimeEnv,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user