read mail with issue tree pipeline works

This commit is contained in:
tsukasa
2023-11-20 22:01:18 +08:00
parent 9c00187041
commit a63e9b6745
12 changed files with 215 additions and 140 deletions
+3 -3
View File
@@ -200,7 +200,7 @@ class OpenAI_ComputeNode(ComputeNode):
max_token_size = 4000
result_token = max_token_size
client = AsyncOpenAI()
client = AsyncOpenAI(api_key=self.openai_api_key)
try:
if llm_inner_functions is None:
logger.info(f"call openai {mode_name} prompts: {prompts}")
@@ -215,7 +215,7 @@ class OpenAI_ComputeNode(ComputeNode):
messages=prompts,
response_format = response_format,
functions=llm_inner_functions,
#max_tokens=result_token,
max_tokens=result_token,
) # TODO: add temperature to task params?
except Exception as e:
logger.error(f"openai run LLM_COMPLETION task error: {e}")
@@ -267,8 +267,8 @@ class OpenAI_ComputeNode(ComputeNode):
logger.info(f"openai_node get task: {task.display()}")
result = await self._run_task(task)
if result is not None:
task.state = ComputeTaskState.DONE
task.result = result
task.state = ComputeTaskState.DONE
asyncio.create_task(_run_task_loop())