-
Notifications
You must be signed in to change notification settings - Fork 18
add a simple openai agent example #7
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
Conversation
Signed-off-by: Samhita Alla <[email protected]>
@kumare3 here’s a simple agent example with just tool calls, and it uses the openai agent sdk. this is an extension to your pb & j example. :) |
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
return await spread_peanut_butter(bread, peanut_butter) | ||
|
||
|
||
@function_tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we have to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean create a shadow function, what do we need to do to make it seamless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cosmicBboy and i were talking about this. flyte.trace
would work seamlessly here, but a task wouldn’t, mainly because both the task and the OpenAI tool decorators materialize the function into a dataclass, so stacking them in either order breaks things.
so we can propose two approaches: one using a task and the other using a trace. ultimately, it’ll be up to the user to choose, depending on whether the tool needs to run in a separate runtime. i know this puts the decision on the user, but i think it’s the most flexible option, unless we want to enforce the use of traces only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should consider creating light-weight utility functions in the flyte.ai
namespace that serve as drop-in replacements for popular frameworks, e.g.
from flyte.ai.openai.agents import function_tool
@function_tool
@env.task
def my_tool(...): ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a follow up?
No description provided.