Skip to content
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

Add OpenAI Integration Test (Sync/Async + Streaming) #598

Merged
merged 12 commits into from
Dec 23, 2024

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 22, 2024

🔍 Review Summary

Purpose

Enhance testing coverage with new integration tests and improve development environments management.

Changes

  • New Feature: Introduced integration tests for OpenAI, supporting various scenarios to ensure accurate analytics tracking.
  • Enhancement: Incorporated python-dotenv for efficient environment variable management in development and testing.

Impact

These updates increase system reliability by expanding test coverage and ensuring consistent environment variable management.

Original Description

OpenAI Integration Test

This PR adds an integration test that calls OpenAI in four ways:

  1. Synchronous without streaming
  2. Synchronous with streaming
  3. Asynchronous without streaming
  4. Asynchronous with streaming

The test verifies that AgentOps correctly tracks all LLM calls by checking the analytics at the end of the session.

Changes

  • Add new integration test in tests/openai_handlers/test_openai_integration.py
  • Add python-dotenv to dev and test dependencies for environment variable management

Testing

  • ✅ All tests pass locally with tox
  • ✅ Code style checks pass with pre-commit

Link to Devin run: https://app.devin.ai/sessions/27239b4aa9fa4638bec5b425f5cdee9c

- Add integration test demonstrating four OpenAI call patterns:
  - Sync (non-streaming)
  - Sync (streaming)
  - Async (non-streaming)
  - Async (streaming)
- Add python-dotenv to dev and test dependencies

Co-Authored-By: Alex Reibman <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

Walkthrough

This update introduces a new integration test for OpenAI, covering four call patterns: synchronous non-streaming, synchronous streaming, asynchronous non-streaming, and asynchronous streaming. The tests ensure accurate tracking by AgentOps analytics. Additionally, the python-dotenv package is added to manage environment variables in development and testing. The tox.ini file is updated to include the new test file in the testing suite.

Changes

File(s) Summary
pyproject.toml Added python-dotenv to manage environment variables in development and testing dependencies.
tests/openai_handlers/test_openai_integration.py Introduced integration tests for OpenAI with four call patterns: sync non-streaming, sync streaming, async non-streaming, and async streaming, ensuring tracking by AgentOps analytics.
tox.ini Included the new test file in the testing suite.

🔗 Related PRs

Instructions

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @bot + *your message*
Example: @bot Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @bot + *feedback*
Example: @bot Do not comment on `save_auth` function !

Execute a command using the format:

@bot + */command*

Example: @bot /updateCommit

Available Commands:

  • /updateCommit ✨: Apply the suggested changes and commit them (or Click on the Github Action button to apply the changes !)
  • /updateGuideline 🛠️: Modify an existing guideline.
  • /addGuideline ➕: Introduce a new guideline.

Tips for Using @bot Effectively:

  • Specific Queries: For the best results, be specific with your requests.
    🔍 Example: @bot summarize the changes in this PR.
  • Focused Discussions: Tag @bot directly on specific code lines or files for detailed feedback.
    📑 Example: @bot review this line of code.
  • Managing Reviews: Use review comments for targeted discussions on code snippets, and PR comments for broader queries about the entire PR.
    💬 Example: @bot comment on the entire PR.

Need More Help?

📚 Visit our documentation for detailed guides on using Entelligence.AI.
🌐 Join our community to connect with others, request features, and share feedback.
🔔 Follow us for updates on new features and improvements.

@areibman areibman enabled auto-merge (squash) December 23, 2024 02:29
@the-praxs the-praxs self-requested a review December 23, 2024 02:34
Copy link
Member

@the-praxs the-praxs left a comment

Choose a reason for hiding this comment

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

Approved but IDK 😆

@areibman areibman merged commit 259beba into main Dec 23, 2024
9 checks passed
@areibman areibman deleted the devin/1734910874-openai-integration-test branch December 23, 2024 02:35
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