Skip to content

Commit

Permalink
Fix duplicate comment
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIvaniv committed Sep 4, 2024
1 parent 5e5dc8f commit cf0c33f
Showing 1 changed file with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,7 @@ export async function toolsAgentExecute(this: IExecuteFunctions): Promise<INodeE
const outputParser = (await getOptionalOutputParsers(this))?.[0];
let structuredOutputParserTool: DynamicStructuredTool | undefined;
/**
* Handles the agent text output and transforms it in case of multi-output.
*
* This method is necessary to handle different output formats from various language models.
* Specifically, it checks if the agent step is the final step (contains returnValues) and determines
* if the output is a simple string (e.g., from OpenAI models) or an array of outputs (e.g., from Anthropic models).
*
* If the output is an array of text outputs, this method will concatenate them into a single string,
* ensuring compatibility with downstream processes that expect a single output string.
*
* Examples:
* 1. Anthropic model output:
* {
* "output": [
* {
* "index": 0,
* "type": "text",
* "text": "The result of the calculation is approximately 1001.8166..."
* }
* ]
* }
*
* 2. OpenAI model output:
* {
* "output": "The result of the calculation is approximately 1001.82..."
* }
*
* This method ensures consistent handling of outputs regardless of the model used,
* Ensures consistent handling of outputs regardless of the model used,
* providing a unified output format for further processing.
*
* This method is necessary to handle different output formats from various language models.
Expand All @@ -147,8 +121,6 @@ export async function toolsAgentExecute(this: IExecuteFunctions): Promise<INodeE
* }
* ```
*
* This method ensures consistent handling of outputs regardless of the model used.
*
* @param steps - The agent finish or agent action steps.
* @returns The modified agent finish steps or the original steps.
*/
Expand Down

0 comments on commit cf0c33f

Please sign in to comment.