fix(text): 文本生成 - 修复声明式协议流式请求与增量输出 (#558)
Original-Commit: b2fef297e8a50d519a0480d120a32eb81234a48f fix(text): 文本生成 - 修复声明式协议流式请求与增量输出
This commit is contained in:
1 parent
b57767eb8b
commit
6a3e454141
5 files changed
+178
-2
No files matched your search
@@ -74,11 +74,15 @@ func runProtocolAdapterTaskWithPolicy(ctx context.Context, input canvasGeneratio
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
body, err := executeProtocolRequest(withProviderRequestKind(ctx, "create"), input.Config, spec)
|
||||
body, streamedResult, err := executeProtocolCreateRequest(withProviderRequestKind(ctx, "create"), input, spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
created, err = adapter.ParseCreate(ctx, body)
|
||||
if streamedResult != nil {
|
||||
created = protocol.CreateResult{Status: protocol.StatusSucceeded, Result: streamedResult}
|
||||
} else {
|
||||
created, err = adapter.ParseCreate(ctx, body)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user