Skip to content

Fix Supervisor agent docs #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix Supervisor agent docs #330

wants to merge 2 commits into from

Conversation

PPraneesh
Copy link
Contributor

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 and Python were missing the mandatory chatHistory 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:

-      "session456"
+      "session456",
+      chatHistory

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:

-        "session456"
+        "session456",
+        chatHistory

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.

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
  • I have linked this PR to an existing issue (required)
Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation for supervisorAgent.processRequest is missing the mandatory chatHistory argument, leading to errors.
1 participant