feat(model): Add new LLMClient and new build tools (#967)

This commit is contained in:
Fangyin Cheng
2023-12-23 16:33:01 +08:00
committed by GitHub
parent 12234ae258
commit 0c46c339ca
30 changed files with 1072 additions and 133 deletions

View File

@@ -211,7 +211,9 @@ class BaseOperator(DAGNode, ABC, Generic[OUT], metaclass=BaseOperatorMeta):
Returns:
AsyncIterator[OUT]: An asynchronous iterator over the output stream.
"""
out_ctx = await self._runner.execute_workflow(self, call_data)
out_ctx = await self._runner.execute_workflow(
self, call_data, streaming_call=True
)
return out_ctx.current_task_context.task_output.output_stream
def _blocking_call_stream(

View File

@@ -130,8 +130,9 @@ async def _trigger_dag(
"Connection": "keep-alive",
"Transfer-Encoding": "chunked",
}
generator = await end_node.call_stream(call_data={"data": body})
return StreamingResponse(
end_node.call_stream(call_data={"data": body}),
generator,
headers=headers,
media_type=media_type,
)