Fix merge conflicts
This commit is contained in:
commit
0790c8ecb4
|
|
@ -606,9 +606,18 @@ class ExceptionTool extends Tool {
|
|||
|
||||
export const formatAgentSteps = (steps: AgentStep[]): BaseMessage[] =>
|
||||
steps.flatMap(({ action, observation }) => {
|
||||
const create_function_message = (observation: string, action: AgentAction) => {
|
||||
let content: string
|
||||
if (typeof observation !== 'string') {
|
||||
content = JSON.stringify(observation)
|
||||
} else {
|
||||
content = observation
|
||||
}
|
||||
return new FunctionMessage(content, action.tool)
|
||||
}
|
||||
if ('messageLog' in action && action.messageLog !== undefined) {
|
||||
const log = action.messageLog as BaseMessage[]
|
||||
return log.concat(new FunctionMessage(observation, action.tool))
|
||||
return log.concat(create_function_message(observation, action))
|
||||
} else {
|
||||
return [new AIMessage(action.log)]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue