docs: add Hy3 API quickstart and 6 examples - #208
Open
ttttxxxx626 wants to merge 1 commit into
Open
Conversation
为 Hy3 API 新增快速入门文档与 6 个核心功能示例,帮助开发者 5 分钟跑通第一次调用、半小时内掌握主要 API 能力。 ### 新增文件 - `quickstart.md`:基础接入信息(Base URL / API Key / Model / 速率限制)、cURL 与 Python 最小示例、核心参数说明、常见报错排查表 - `examples/01_basic_chat.md` + `.py`:单轮对话 + 多轮上下文对话 - `examples/02_streaming.md` + `.py`:流式输出,逐 chunk 解析,含 `include_usage` 用量统计 - `examples/03_stream_vs_non_stream.md` + `.py`:非流式 vs 流式时延对比(TTFT + 总耗时) - `examples/04_tool_calling.md` + `.py`:工具调用闭环(单次调用 + 多轮工具循环) - `examples/05_reasoning_mode.md` + `.py`:深度思考开关与 `low/medium/high` 三档对比 - `examples/06_error_retry.md` + `.py`:指数退避重试,区分可重试/永久错误 ### 特点 - 每个示例均包含完整请求(HTTP 载荷 + Python SDK)、完整响应 JSON 解析、字段说明和示例输出 - 所有 `.py` 文件开箱即用,统一通过 `.env` 管理配置 - 代码遵循 OpenAI SDK 规范,`thinking`/`reasoning_effort` 等非标准参数通过 `extra_body` 传递
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为 Hy3 API 新增快速入门文档与 6 个核心功能示例,帮助开发者 5 分钟跑通第一次调用、半小时内掌握主要 API 能力。
新增文件
quickstart.md:基础接入信息(Base URL / API Key / Model / 速率限制)、cURL 与 Python 最小示例、核心参数说明、常见报错排查表examples/01_basic_chat.md+.py:单轮对话 + 多轮上下文对话examples/02_streaming.md+.py:流式输出,逐 chunk 解析,含include_usage用量统计examples/03_stream_vs_non_stream.md+.py:非流式 vs 流式时延对比(TTFT + 总耗时)examples/04_tool_calling.md+.py:工具调用闭环(单次调用 + 多轮工具循环)examples/05_reasoning_mode.md+.py:深度思考开关与low/medium/high三档对比examples/06_error_retry.md+.py:指数退避重试,区分可重试/永久错误特点
.py文件开箱即用,统一通过.env管理配置thinking/reasoning_effort等非标准参数通过extra_body传递关联 Issue
Closes #1