Skip to content

feat: Added agent example for openai-agents#185

Merged
dhruvj07 merged 1 commit intomainfrom
openai_agents_branch
Apr 15, 2025
Merged

feat: Added agent example for openai-agents#185
dhruvj07 merged 1 commit intomainfrom
openai_agents_branch

Conversation

@dhruvj07
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Hello @dhruvj07, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request introduces a new example for using OpenAI agents with the Javelin SDK. The example demonstrates how to create an orchestrator agent that uses two child agents: one for summarizing a topic (a "faux search" agent) and another for translating the summary into Spanish. The example also shows how to register the OpenAI client with Javelin for monitoring and tracing, and how to set the default OpenAI client for the Agents SDK.

Highlights

  • New Example: Adds a new example openai_agents_javelin.py demonstrating the integration of OpenAI agents with the Javelin SDK.
  • Agent Orchestration: Illustrates how to create an orchestrator agent that uses child agents for specific tasks (summarization and translation).
  • Javelin Integration: Shows how to register the OpenAI client with Javelin for monitoring and tracing agent interactions.

Changelog

Click here to see the changelog
  • examples/agents/openai_agents_javelin.py
    • Initial commit of the openai_agents_javelin.py example file.
    • Imports necessary libraries including agents, openai, javelin_sdk, and dotenv.
    • Loads environment variables for OpenAI and Javelin API keys and base URL.
    • Configures the OpenAI client to use the chat completions endpoint.
    • Registers the OpenAI client with Javelin for monitoring.
    • Creates a 'FauxSearchAgent' that summarizes a user's topic using its internal knowledge.
    • Creates a 'TranslatorAgent' that translates English text to Spanish.
    • Creates an 'OrchestratorAgent' that calls the 'FauxSearchAgent' and then the 'TranslatorAgent'.
    • Defines a main function to run the orchestrator agent with a sample user query.
    • Includes a call to asyncio.run(main()) to execute the example.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


An agent's quest,
To summarize, then translate,
A task well begun.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

The code introduces an example of using OpenAI agents with Javelin for tracing and monitoring. It sets up an orchestrator agent that uses a faux search agent and a translator agent. The example demonstrates how to register OpenAI clients with Javelin and how to use the Agents SDK with Javelin-patched clients. Overall, the code is well-structured and provides a clear example of how to integrate Javelin with OpenAI agents.

Merge Readiness

The code provides a valuable example of integrating Javelin with OpenAI agents. I am unable to directly approve the pull request, and users should have others review and approve this code before merging. Given the absence of any critical or high severity issues, the pull request appears to be in good shape for merging.

@dhruvj07 dhruvj07 merged commit 33e601d into main Apr 15, 2025
6 of 7 checks passed
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.

3 participants