Skip to content

Conversation

@fcogidi
Copy link
Collaborator

@fcogidi fcogidi commented Jan 13, 2026

Summary

This PR refactors the reference implementations to improve client management, session handling, and code organization across the repository.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test improvements
  • 🔒 Security fix

Changes Made

  • Added new AsyncClientManager class for managing lifecycle of various async clients (AsyncOpenAI and Async Weaviate client) with centralized configuration.
  • Added new session management utilities for agent conversations, which allows the agent to keep a conversation history.
  • Improved gradio message handling for better UX i.e. intermediate thoughts, actions and observations are more easily distinguishable from the agent's final response.
  • Utility improvements:
    • kb_weaviate.py - Refactored to accept Configs object for cleaner parameter management
    • news_events.py - Added User-Agent header to AsyncClient
    • `logging.py- - Added return type annotation
    • oai_sdk_setup.py - Removed unused nest_asyncio import
  • Updated affected tests.
  • Updated dependencies.

Testing

  • Tests pass locally (uv run pytest tests/)
  • Linting passes (uv run ruff check src/)

fcogidi added 13 commits January 9, 2026 17:30
…improved client management and session handling

- Updated verbose.py to integrate session management for agents and streamline logging setup.
- Refactored app.py in code_interpreter to use AsyncClientManager and enhance session handling.
- Modified MCP app.py to implement session management and remove unnecessary signal handling.
- Revised run_eval.py to utilize AsyncClientManager for OpenAI client management.
- Updated synthesize_data.py to incorporate AsyncClientManager and improve data generation processes.
- Refactored synthesize_data_e2b.py to utilize AsyncClientManager and streamline test case generation.
@fcogidi fcogidi self-assigned this Jan 13, 2026
@fcogidi fcogidi merged commit aaa6bc9 into main Jan 13, 2026
4 checks passed
@fcogidi fcogidi deleted the fco/refactor_ref_impls branch January 13, 2026 20:06
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