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

Autogen latency v2 #31

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

Autogen latency v2 #31

wants to merge 15 commits into from

Conversation

raghavdixit99
Copy link
Owner

@raghavdixit99 raghavdixit99 commented Nov 9, 2024

🔍 Review Summary

Purpose:

  • Set the default end_state to "Indeterminate" to improve session handling.
  • Integrate Entelligence chat feature for real-time communication with users.
  • Add support for AI21 and Mistral using their respective Python SDKs.
  • Implement connection pooling to enhance HTTP client performance.
  • Update server with an autogen endpoint and improve session handling.

Key Changes:

  • Enhancement: Default end_state set to "Indeterminate" for improved session handling.
  • New Feature: Integration of Entelligence chat feature for real-time communication.
  • New Feature: Added support for AI21 and Mistral via their respective Python SDKs.
  • Enhancement: Implemented connection pooling to improve HTTP client performance.
  • New Feature: Updated server with autogen endpoint and improved session handling.
  • Documentation: Updated README and assets with new v2 screenshots and improved documentation.

Impact:

  • Enhances user experience by improving session handling and real-time communication.
  • Provides support for AI21 and Mistral, expanding platform capabilities.
  • Improves HTTP client performance and server functionality for better overall system performance.
Original Description

No existing description found

HowieG and others added 15 commits October 30, 2024 13:37
…AgentOps-AI#479)

In this feature we're adding the pop up chat of entelligence inside the agentops repository
* make start_session non blocking

* fix build issue

* bump version

* callback for start session now that it is async

* fix callback

* unpin dependencies (AgentOps-AI#434)

Co-authored-by: Howard Gil <[email protected]>

* bump version number

* wip

* change autogen getting run every time

* remove prints

* remove more prints

* suppress warnings

* exponential retry to close data

* removed event counter

* fix requests mock

* remove print

* fixed more tests

* removed inits from test_agent; does not require a client

* create requests fixture

* Scope fixtures

* black run

* remove bad files

* add spaces back

* revert session threading changes

* remove callback

* revert session changes

* revert session

* fix test

* update tests

* update tox to install local build instead of pypi

* replace http client with requests so requests_mock works properly

* fixed multiple sessions

* fix tool recorder

* removed test logs, fixed request count tests

* set fixture scopes

* Fixed missing async tests failing in tox, updated tox

* fixed missing pass in tests

* fixed timing

* created rc branch

---------

Co-authored-by: Shawn Qiu <[email protected]>
Co-authored-by: Howard Gil <[email protected]>
* Updated README and assets with new v2 screenshots

* updated font size on dashboard banner
Add Hover Badges and Update Badge Style for Social Links
…#382)

* add initial files for support

* working sync client

* stream not working

* updated examples notebook for current testing

* fix for `delta.content` and cleanup

* cleanup again

* cleanup and add tool event

* structure examples notebook

* add contextual answers tracking

* cleanup example notebook

* create testing file

* clean example notebook again

* rename examples directory

* updated docs page

* wrap `chunk.choices[0].delta.content` in `str(...)`

* update doc

---------

Co-authored-by: reibs <[email protected]>
…Ops-AI#374)

* add mistral support

* linting

* fix typo

* add tests

* add examples notebook

* linting

* fix langchain typo in pyproject.toml (updated to 0.2.14)

* fix mistralai import and `undo_override` function

* add mistral to readme

* fix typo

* modified self.llm_event to llm_event

* refactoring

* black

* rename examples directory

* fix merge

* init merge

* updated model name so that tokencost will recognize this as a mistral model

* black lint

---------

Co-authored-by: reibs <[email protected]>
Copy link

Walkthrough

This update introduces several enhancements and new features to the AgentOps repository. Key changes include setting the default session end state to "Indeterminate" in agentops/session.py, integrating the Entelligence chat feature, and adding support for AI21 and Mistral via their respective Python SDKs. Additionally, connection pooling has been implemented to improve HTTP client performance, and the server has been updated with an autogen endpoint. Various documentation updates and test improvements are also included, alongside minor bug fixes and code refactoring.

Changes

File(s) Summary
agentops/session.py Set the default end_state to "Indeterminate" when creating a session.
docs/v1/scripts/entelligence.js, docs/v1/styles/styles.css Added Entelligence chat integration and corresponding styles.
agentops/__init__.py, agentops/client.py, agentops/helpers.py, agentops/host_env.py, pyproject.toml, tests/test_agent.py, tests/test_canary.py, tests/test_events.py, tests/test_pre_init.py, tests/test_record_action.py, tests/test_record_tool.py, tests/test_session.py, tests/test_teardown.py, tox.ini Various fixes and improvements, including making start_session non-blocking, fixing build issues, and updating tests.
README.md, docs/images/external/app_screenshots/* Updated README and assets with new v2 screenshots and improved documentation.
agentops/llms/__init__.py, agentops/llms/ai21.py, docs/v1/integrations/ai21.mdx, examples/ai21_examples/ai21_examples.ipynb, tests/core_manual_tests/providers/ai21_canary.py Added support for AI21 via the ai21 Python SDK, including examples and documentation.
agentops/llms/mistral.py, examples/mistral_examples/mistral_example.ipynb, tests/core_manual_tests/providers/mistral_canary.py Added support for Mistral via the mistral Python SDK, including examples and documentation.
agentops/http_client.py Implemented connection pooling to enhance HTTP client performance.
tests/core_manual_tests/api_server/server.py Updated server with an autogen endpoint and improved session handling.
Files selected (32)
  • agentops/session.py
    - docs/v1/scripts/entelligence.js
    - docs/v1/styles/styles.css
    - agentops/init.py
    - agentops/client.py
    - agentops/helpers.py
    - agentops/host_env.py
    - pyproject.toml
    - docs/snippets/github-stars.mdx
    - docs/v1/integrations/langchain.mdx
    - docs/v1/introduction.mdx
    - docs/v1/quickstart.mdx
    - README.md
    - README.md
    - agentops/llms/init.py
    - agentops/llms/ai21.py
    - docs/v1/integrations/ai21.mdx
    - examples/ai21_examples/ai21_examples.ipynb
    - tests/core_manual_tests/providers/ai21_canary.py
    - README.md
    - agentops/llms/init.py
    - agentops/llms/mistral.py
    - examples/mistral_examples/mistral_example.ipynb
    - tests/core_manual_tests/providers/anthropic_canary.py
    - tests/core_manual_tests/providers/mistral_canary.py
    - agentops/init.py
    - agentops/http_client.py
    - agentops/helpers.py
    - agentops/http_client.py
    - tests/core_manual_tests/api_server/server.py
    - agentops/http_client.py
    - tests/core_manual_tests/api_server/server.py
Files ignored (19)
  • tests/test_agent.py
    - tests/test_canary.py
    - tests/test_events.py
    - tests/test_pre_init.py
    - tests/test_record_action.py
    - tests/test_record_tool.py
    - tests/test_session.py
    - tests/test_teardown.py
    - tox.ini
    - docs/images/external/app_screenshots/chat-viewer.png
    - docs/images/external/app_screenshots/dashboard-banner.png
    - docs/images/external/app_screenshots/dashboard_banner.png
    - docs/images/external/app_screenshots/overview-charts.png
    - docs/images/external/app_screenshots/overview.png
    - docs/images/external/app_screenshots/session-drilldown-graphs.png
    - docs/images/external/app_screenshots/session-drilldown-metadata.png
    - docs/images/external/app_screenshots/session-overview.png
    - docs/images/external/app_screenshots/session-replay.png
    - tox.ini
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:

    @Entelligence.AI + *your message*

    • Example: @Entelligence.AI Can you suggest improvements for this code?
  • Execute a command using the format:

    @Entelligence.AI + *"/command"*

Available Commands:

  • /updateCommit: Apply the suggested changes and commit them.
  • /updateGuideline: Modify an existing guideline.
  • /addGuideline: Introduce a new guideline.

Tips for Using @Entelligence.AI Effectively:

  • Specific Queries: For the best results, be specific with your requests. Example: @Entelligence.AI summarize the changes in this PR.
  • Focused Discussions: Tag @Entelligence.AI directly on specific code lines or files for detailed feedback.
  • Managing Reviews: Use review comments for targeted discussions on code snippets, and PR comments for broader queries about 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.

Comment on lines 24 to 48
</div>

<p align="center">
<a href="https://twitter.com/agentopsai/">🐦 Twitter</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://discord.gg/FagdcwwXRR">📢 Discord</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://app.agentops.ai/?ref=gh">🖇️ Dashboard</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://docs.agentops.ai/introduction">📙 Documentation</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://entelligence.ai/AgentOps-AI&agentops">💬 Chat with Docs</a>
<a href="https://twitter.com/agentopsai/">
<img src="https://img.shields.io/twitter/follow/agentopsai?style=social" alt="Twitter" style="height: 20px;">
</a>
<a href="https://discord.gg/FagdcwwXRR">
<img src="https://img.shields.io/badge/discord-7289da.svg?style=flat-square&logo=discord" alt="Discord" style="height: 20px;">
</a>
<a href="https://app.agentops.ai/?ref=gh">
<img src="https://img.shields.io/badge/Dashboard-blue.svg?style=flat-square" alt="Dashboard" style="height: 20px;">
</a>
<a href="https://docs.agentops.ai/introduction">
<img src="https://img.shields.io/badge/Documentation-orange.svg?style=flat-square" alt="Documentation" style="height: 20px;">
</a>
<a href="https://entelligence.ai/AgentOps-AI&agentops">
<img src="https://img.shields.io/badge/Chat%20with%20Docs-green.svg?style=flat-square" alt="Chat with Docs" style="height: 20px;">
</a>
</p>



<div style="justify-content: center">
<img src="docs/images/external/app_screenshots/dashboard_banner.png" alt="Dashboard Banner">
<img src="docs/images/external/app_screenshots/dashboard-banner.png" alt="Dashboard Banner">
</div>

Choose a reason for hiding this comment

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

ℹ️ Performance Improvement

Optimize Badge Images for Performance

The update to use badge images for social links in the README.md file enhances the visual appeal and provides a more interactive experience for users. However, ensure that the badge images are optimized for performance to prevent any unnecessary loading delays, especially on slower connections.

Comment on lines 157 to 179
text-align: center;
padding: 0;
margin: 0;
}

.hidden {
display: none;
}

@media (min-width: 1024px) {
.lg\:block {
display: block;
}
.lg\:hidden {
display: none;
}
}

@media (min-width: 768px) {
.md\:block {
display: block;
}
}

Choose a reason for hiding this comment

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

ℹ️ Logic Error

Potential Conflict with Visibility Classes

The CSS class .hidden is defined to set display: none;. Ensure that this class is not applied to elements that should be visible on larger screens, as it might conflict with the .lg:block and .md:block classes. Consider using more specific class names or conditions to avoid unintended hiding of elements.

Comment on lines 47 to 57


def get_installed_packages():

try:
return {
# TODO: test
# TODO: add to opt out
"Installed Packages": {
dist.metadata["Name"]: dist.version
dist.metadata.get("Name"): dist.metadata.get("Version")
for dist in importlib.metadata.distributions()
}
}

Choose a reason for hiding this comment

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

ℹ️ Logic Error

Ensure Default Values for Metadata Retrieval

The change from dist.metadata["Name"] to dist.metadata.get("Name") and similarly for Version introduces a potential issue where None could be returned if the metadata keys do not exist. This could lead to unexpected behavior when the returned dictionary is used. Consider providing a default value to ensure the dictionary always contains valid strings.

-                dist.metadata.get("Name"): dist.metadata.get("Version")
+                dist.metadata.get("Name", "Unknown"): dist.metadata.get("Version", "0.0.0")
Commitable Code Suggestion:
Suggested change
def get_installed_packages():
try:
return {
# TODO: test
# TODO: add to opt out
"Installed Packages": {
dist.metadata["Name"]: dist.version
dist.metadata.get("Name"): dist.metadata.get("Version")
for dist in importlib.metadata.distributions()
}
}
dist.metadata.get("Name", "Unknown"): dist.metadata.get("Version", "0.0.0")

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.

7 participants