Fix streaming and file IO edge cases
Repair streaming callback/error handling and make file/session handling safer so the core API behaves correctly under real usage. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ DSTALK_API void dstalk_set_model(const char* model);
|
||||
/* 同步对话: 发送 input,返回完整 AI 回复 (调用方通过 dstalk_free_string 释放) */
|
||||
DSTALK_API int dstalk_chat(const char* input, char** output);
|
||||
|
||||
/* 流式对话: 每收到一个 token 调用回调,回调返回 0 可提前取消 */
|
||||
/* 流式对话: 每收到一个 token 调用回调,回调返回 0 继续,非 0 取消 */
|
||||
typedef int (*dstalk_stream_cb)(const char* token, void* userdata);
|
||||
DSTALK_API int dstalk_chat_stream(const char* input, dstalk_stream_cb cb, void* userdata);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user