Skip to content

Conversation

manfredcalvo
Copy link

In this pull request, I am making the following changes to the GenieAgent:

  1. Creating a Python class that extends the RunnableLambda interface to create the GenieAgent instead of having a function to represent the GenieAgent.
  2. Adding a new boolean parameter to the GenieAgent class called "return_metadata." If the flag is True, then the output of the invoke function of the GenieAgent will have two keys: "messages" and "metadata." This metadata contains the direct response from GenieAPI, which is the object GenieResponse.
  3. Some minor refactoring of the GenieAgent unit tests.

If the following screenshots, you can see the output dict and the output trace in both scenarios (return_metadata True and False)

When return_medata is False (this is the default value)

Screenshot 2025-02-19 at 6 48 13 PM

When return_metadata is True

Screenshot 2025-02-19 at 6 49 45 PM

from typing import Dict, Any


class GenieAgent(RunnableLambda):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: add a docstring

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FMurray Doc string added to the class.

@manfredcalvo
Copy link
Author

manfredcalvo commented Feb 20, 2025

@bbqiu, let me know if this can be merged or if I need to follow a different process.

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.

2 participants