Automated update of Base Application package.
This commit is contained in:
parent
f24569f498
commit
559b4ede76
BIN
dist/app-1.0.0-py3-none-any.whl
vendored
BIN
dist/app-1.0.0-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/app-1.0.0.tar.gz
vendored
BIN
dist/app-1.0.0.tar.gz
vendored
Binary file not shown.
@ -77,7 +77,7 @@ class Agent:
|
|||||||
|
|
||||||
async def register_tool_handler(self, name, method):
|
async def register_tool_handler(self, name, method):
|
||||||
self.tool_handlers[name] = method
|
self.tool_handlers[name] = method
|
||||||
|
|
||||||
async def dalle2(
|
async def dalle2(
|
||||||
self, prompt: str, width: Optional[int] = 512, height: Optional[int] = 512
|
self, prompt: str, width: Optional[int] = 512, height: Optional[int] = 512
|
||||||
) -> dict:
|
) -> dict:
|
||||||
@ -152,16 +152,11 @@ class Agent:
|
|||||||
for tool in run.required_action.submit_tool_outputs.tool_calls:
|
for tool in run.required_action.submit_tool_outputs.tool_calls:
|
||||||
tool_handler = self.tool_handlers[tool.name]
|
tool_handler = self.tool_handlers[tool.name]
|
||||||
output = await tool_handler(tool.arguments)
|
output = await tool_handler(tool.arguments)
|
||||||
outputs.append(dict(
|
outputs.append({"tool_call_id": tool.id, "output": output})
|
||||||
tool_call_id=tool.id,
|
|
||||||
output=output
|
|
||||||
))
|
|
||||||
if outputs:
|
if outputs:
|
||||||
run = client.beta.threads.runs.submit_tool_outputs_and_poll(
|
run = client.beta.threads.runs.submit_tool_outputs_and_poll(
|
||||||
thread_id=self.thread.id,
|
thread_id=self.thread.id, run_id=run.id, tool_outputs=outputs
|
||||||
run_id=run.id,
|
)
|
||||||
tool_outputs=outputs
|
|
||||||
)
|
|
||||||
run = self.client.beta.threads.runs.retrieve(
|
run = self.client.beta.threads.runs.retrieve(
|
||||||
thread_id=self.thread.id, run_id=run.id
|
thread_id=self.thread.id, run_id=run.id
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user