Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Link #329
Fixes #329
Summary
Changes
This PR addresses an inconsistency in the documentation for the SupervisorAgent's processRequest method. The documentation examples for both
JavaScript/TypeScript
andPython
were missing the mandatorychatHistory
argument.The changes made in docs/src/content/docs/agents/built-in/supervisor-agent.mdx are:
JavaScript/TypeScript Documentation Example (around line 52):
Added the line
const chatHistory = [];
to initialize an empty chatHistory array.Modified the supervisorAgent.processRequest call to include chatHistory as the fourth argument:
Python Documentation Example (around line 87, new line 89):
Added the line
chatHistory = []
to initialize an empty chatHistory list.Modified the supervisor_agent.process_request call to include chatHistory as the fourth argument:
These changes ensure that the documentation examples align with the actual method signature (
processRequest(inputText, userId, sessionId, chatHistory, additionalParams)
), preventing errors for users who follow the documentation.User experience
Before this change:
Users following the SupervisorAgent.processRequest examples directly from the documentation would encounter a runtime error, typically:
Error processing request: chatHistory is not iterable
This is because the
chatHistory
argument, which is mandatory in the method's implementation, was omitted from the documented examples. This would lead to confusion and require users to investigate the source code to identify the missing parameter, hindering a smooth onboarding or usage experience.After this change:
Users following the updated SupervisorAgent.processRequest examples in the documentation will have a runnable code snippet. The examples now correctly include the chatHistory parameter (initialized as an empty list/array for demonstration purposes). This will lead to:
Correctness: The documentation accurately reflects the method's requirements.
Improved Usability: Users can copy and paste the example code and expect it to work without modification (assuming the rest of their setup is correct).
Reduced Friction: Developers will not encounter the "chatHistory is not iterable" error when using the documented examples, saving them debugging time and frustration.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.