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

feat: Enhance backend with context management, error handling, and refactored code #4286

Merged
merged 49 commits into from
Nov 8, 2024

Commits on Nov 1, 2024

  1. Configuration menu
    Copy the full SHA
    c16febb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f21cad7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3bc072f View commit details
    Browse the repository at this point in the history
  4. Add agent components for action routing, decision-making, execution, …

    …and context management
    
    - Introduced `AgentActionRouter` to route agent flow based on action type.
    - Added `DecideActionComponent` for determining actions from context and prompts.
    - Implemented `ExecuteActionComponent` to execute actions using available tools.
    - Created `GenerateThoughtComponent` for generating thoughts based on context.
    - Developed `ProvideFinalAnswerComponent` to generate final answers from context.
    - Built `AgentContextBuilder` for constructing `AgentContext` instances.
    - Added `ObserveResultComponent` to process and observe action results.
    - Implemented `CheckTerminationComponent` to determine if the agent should continue or terminate.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    f2e0944 View commit details
    Browse the repository at this point in the history
  5. Add AgentContext class for managing agent state and context serializa…

    …tion
    
    - Introduced `AgentContext` class in `context.py` to handle agent state, including tools, language model, and context history.
    - Implemented serialization methods for converting agent context to JSON-compatible format.
    - Added validation for language model instances to ensure compatibility.
    - Provided methods for updating and retrieving full context, including context history management.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    383b05f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    949cf2f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3025d42 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8e9237d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8c05d6a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9bd5eda View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    03bdb8e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9239fa0 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ce3c90b View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c705228 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    acccceb View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    46fbe77 View commit details
    Browse the repository at this point in the history
  17. Add context management methods to custom component class

    - Introduced a `_ctx` attribute to store context data.
    - Added `ctx` property to access the graph's context, raising an error if the graph is not built.
    - Implemented `add_to_ctx` method to add key-value pairs to the context with an optional overwrite flag.
    - Implemented `update_ctx` method to update the context with a dictionary of values, ensuring the graph is built and the input is a dictionary.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    e0bde19 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    ad485c3 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    5c5e9b4 View commit details
    Browse the repository at this point in the history
  20. Convert get_response method to asynchronous and update graph proces…

    …sing to use async iteration.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    abfec35 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    cb8f451 View commit details
    Browse the repository at this point in the history
  22. Refactor Agent Flow JSON: Simplify input types and update agent compo…

    …nent structure
    
    - Removed "BaseTool" from input types for "ToolCallingAgent" to streamline tool handling.
    - Updated agent component to a more modular structure with new prompts and input configurations.
    - Replaced deprecated methods and fields with updated implementations for improved functionality.
    - Adjusted metadata and configuration settings for better clarity and usability.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    0c8cfae View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    ae5a2f2 View commit details
    Browse the repository at this point in the history
  24. Add Agent import to init, improve error handling, and clean up imports

    - Added `Agent` import to `__init__.py` for better module accessibility.
    - Improved error handling in `aiml_embeddings.py` by raising a `ValueError` when the expected embedding count is not met.
    - Cleaned up redundant imports in `test_cycles.py` to enhance code readability.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    736e580 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    4b0bb3d View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    aeba83a View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    3559812 View commit details
    Browse the repository at this point in the history
  28. Refactor graph tests to include new components and update iteration l…

    …ogic
    
    - Replaced complex agent flow with a simplified guessing game using OpenAI components and conditional routing.
    - Introduced `TextInputComponent` and updated `ChatInput` initialization.
    - Added new test `test_conditional_router_max_iterations` to validate conditional routing with max iterations.
    - Updated graph cyclicity assertions and snapshot checks for improved test coverage.
    - Removed deprecated agent components and related logic.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    bf9cd5c View commit details
    Browse the repository at this point in the history
  29. Refactor conditional router to return message consistently and use it…

    …erate_and_stop_once method
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    c00eaff View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    2f5b04f View commit details
    Browse the repository at this point in the history
  31. Remove unnecessary @override decorator and add # noqa: ARG002 com…

    …ments for unused arguments
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    3202716 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    d1b690f View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    9bd0ad4 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    917eaec View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    ad1ebe3 View commit details
    Browse the repository at this point in the history
  36. Implement synchronous graph execution using threading and queues

    - Removed `nest_asyncio` dependency and replaced it with a new threading-based approach for synchronous graph execution.
    - Introduced a `queue.Queue` to handle results and exceptions between threads.
    - Added a new thread to run asynchronous code, ensuring proper event loop management and task completion.
    - Updated methods to return sorted lists of runnable vertices for consistency.
    ogabrielluiz committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    3edcb36 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2024

  1. Configuration menu
    Copy the full SHA
    e3d2389 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2024

  1. Configuration menu
    Copy the full SHA
    dadaad5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    541cc94 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    21d434e View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Configuration menu
    Copy the full SHA
    541a31e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d591f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a57fd04 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    edfa7b7 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2024

  1. Configuration menu
    Copy the full SHA
    195810b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f244aba View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f3bcbc1 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2024

  1. Configuration menu
    Copy the full SHA
    cb61de5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    06d79bf View commit details
    Browse the repository at this point in the history