Skip to content

[Agent Framework] Implement Core Agent Base Class using PydanticAI and Google Gemini #1

@dineshpinto

Description

@dineshpinto
  • Description:
    Develop the foundational Agent Base Class for the Flare AI Kit using Pydantic models. This class is crucial for creating robust, type-validated AI agents. It will define the core agent lifecycle, including methods for initialization, processing input, updating context, and managing conversation history. The conversation history should be storable and injectable as future context for the agent. Implement a dedicated LLM adapter specifically for Google Gemini. This adapter will allow AI agents built with the Flare AI Kit to use Google Gemini as their underlying language model. It should integrate seamlessly with the Agent Base Class and provide a clear interface for LLM interactions.
  • Acceptance Criteria:
    • An Agent base class is created using Pydantic models for strict type validation of inputs and outputs.
    • The class includes clearly defined methods such as initialize(), process_input(), and update_context() to manage standard agent behavior.
    • A mechanism for managing conversation history (e.g., storing a certain length of messages) is implemented and can be used to provide context in subsequent interactions.
    • Unit tests cover agent instantiation, all lifecycle methods, and Pydantic type validation.
    • An adapter class for Google Gemini is created.
    • The adapter integrates with the abstracted LLM interface defined within the Agent Framework.
    • It handles API calls to Google Gemini for functionalities like text generation and, if applicable, embeddings.
    • Configuration for API keys and model-specific parameters is securely managed.
    • Unit tests verify successful communication and response handling, ideally using a mocked Gemini API.
  • Key Files/Modules Involved (Tentative):
    • flare_ai_kit/agent/base.py (New file to be created)
    • flare_ai_kit/agent/gemini_agent.py (New file to be created)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions