fix: None type in cot assistant app (#2142)
This commit is contained in:
parent
c17baef172
commit
501caf0a69
2 changed files with 2 additions and 4 deletions
|
|
@ -473,7 +473,7 @@ class AssistantCotApplicationRunner(BaseAssistantApplicationRunner):
|
|||
|
||||
result = ''
|
||||
for scratchpad in agent_scratchpad:
|
||||
result += scratchpad.thought + next_iteration.replace("{{observation}}", scratchpad.observation) + "\n"
|
||||
result += scratchpad.thought + next_iteration.replace("{{observation}}", scratchpad.observation or '') + "\n"
|
||||
|
||||
return result
|
||||
|
||||
|
|
@ -543,7 +543,7 @@ class AssistantCotApplicationRunner(BaseAssistantApplicationRunner):
|
|||
# add assistant message
|
||||
if len(agent_scratchpad) > 0:
|
||||
prompt_messages.append(AssistantPromptMessage(
|
||||
content=agent_scratchpad[-1].thought + "\n" + agent_scratchpad[-1].observation
|
||||
content=(agent_scratchpad[-1].thought or '') + "\n" + (agent_scratchpad[-1].observation or '')
|
||||
))
|
||||
|
||||
# add user message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue