-
Notifications
You must be signed in to change notification settings - Fork 14
[feat][prompt] prompt as a service (ptaas) #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
ea086d4 to
ed848fe
Compare
taoyifan89
reviewed
Sep 9, 2025
…treaming support Change-Id: I54cf6b1895a94ee1c82d6384be711eeaaed4875f Co-Authored-By: Coda <coda@bytedance.com> refactor: [Coda] 重构execute_prompt和aexecute_prompt方法参数,统一底层传参方式 Change-Id: Ib480cc24e18ac2d68a0abf964aa29599b683d88f Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] refactor execute interfaces and enhance prompt entities - Remove ExecuteParam exposure from entities directory - Refactor _build_execute_request method parameters - Restructure object definitions in internal/prompt/openapi.py - Align object fields with cozeloop-go implementation - Add base64_data field to ContentPart and improve converter.py - Enhance execute and streaming functionality Change-Id: I34d8f03f6b9de8b170f789562e71f92089ed6cfc Co-Authored-By: Coda <coda@bytedance.com> refactor: [Coda] merge duplicate _convert_to_result methods into unified converter (LogID: 20250904221721010091104016861EFDC) Co-Authored-By: Coda <coda@bytedance.com> gitignore Change-Id: I9042daa98841f3cd99036ccddeac04aa34695fde feat: [Coda] 修复cozeloop-python流处理逻辑与Go版本保持一致 - 重构StreamProcessor类,统一数据前缀处理格式(data:) - 实现完整的错误处理机制,包括错误前缀检测和累积器 - 添加对event:行的忽略处理,与Go版本保持一致 - 重构process_lines和aprocess_lines方法,消除重复代码 - 移除[DONE]标记处理,统一流结束检测逻辑 - 增强错误响应解析和RemoteServiceError异常处理 Change-Id: I910ea7182168eb55326c9e13aedf953f8718b180 Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] 创建ptaas示例目录,提供execute_prompt和aexecute_prompt的完整使用示例 (LogID: 2025090500044019216800101072170CF) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] 修复流式调用中httpx上下文管理器的headers访问错误 (LogID: 202509050038421921680010102185489) Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] remove StreamResponseWrapper and simplify post_stream to return httpx.Response directly (LogID: 2025090500503319216800101012637F9) Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] implement context manager for StreamReader to fix post_stream context issue (LogID: 20250905013341192168001010942E193) Co-Authored-By: Coda <coda@bytedance.com> refactor: [Coda] simplify ExecuteStreamReader to only accept stream_context (LogID: 20250905013341192168001010942E193) Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] implement StreamReader based on Fornax Stream design (LogID: 20250905020453192168001010730B720) Co-Authored-By: Coda <coda@bytedance.com> refactor: [Coda] remove Context classes, implement context manager directly in StreamReader (LogID: 20250905020453192168001010730B720) Co-Authored-By: Coda <coda@bytedance.com> refactor: [Coda] replace execute_prompt with SSE-based implementation (LogID: 20250905020453192168001010730B720) Co-Authored-By: Coda <coda@bytedance.com> ptaas Change-Id: I3be6b974680ea03ecb387263f851d2b510715625 fix: [Coda] handle non-200 HTTP status in execute_stream post_stream (LogID: 20250905140202010091104016024A92C) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] restore stream architecture with delayed status check (LogID: 20250905140202010091104016024A92C) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] Correctly parse streaming errors to raise RemoteServiceError (LogID: 20250905140202010091104016024A92C) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] read response content before json() in stream error handling (LogID: 20250905140202010091104016024A92C) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] 修复ExecuteStreamReader close()方法AttributeError (LogID: 202509051616010100911040169551803) Co-Authored-By: Coda <coda@bytedance.com> ptaas example Change-Id: I46e0392a3f4e47b0f435b6ee34c6d15a46425fad feat: [Coda] 重写PTaaS Python示例,参考Go版本保持场景和注释一致性 (LogID: 20250908180534010091104016071B631) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] 添加同步流式示例并将所有PTaaS示例注释改为英文 (LogID: 20250908180534010091104016071B631) Co-Authored-By: Coda <coda@bytedance.com> fix: [Coda] 修复PTaaS异步流处理中的上下文管理器协议错误 (LogID: 2025090819310001009110401618550CC) Co-Authored-By: Coda <coda@bytedance.com> refactor: [Coda] 清理未使用的异步流处理方法 (LogID: 2025090819310001009110401618550CC) Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] add ConfigDict(use_enum_values=True) to models with enum fields (LogID: 20250908201801010091104016415D94E) Co-Authored-By: Coda <coda@bytedance.com> ptaas example Change-Id: If358626bdfa18dfc0e09bf5758e2950bef7fd800 feat: [Coda] add timeout parameter support for execute_prompt and aexecute_prompt methods (LogID: 202509082041490100911040169244AFC) Co-Authored-By: Coda <coda@bytedance.com> feat: [Coda] set default timeout to 10min for execute_prompt and aexecute_prompt (LogID: 202509082041490100911040169244AFC) Co-Authored-By: Coda <coda@bytedance.com> ptaas example Change-Id: Ie8552a762bc1804e840132449869dee68a5e4b7f delete useless example Change-Id: I3f0a22ced554f372537a68ce8cb411239311f71f delete useless example Change-Id: Ibfd4f38295ab6f0635d3c9ab96579587f6d35a15
c80b040 to
4061d81
Compare
Change-Id: I885e86a70f3ef146163e234ffd1d8593cfe4e9f3
JqRrt
approved these changes
Sep 10, 2025
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.
ptaas
Co-Authored-By: Coda coda@bytedance.com