Agents Module
The rakam_systems.generation.agents module provides classes for executing various actions such as query classification, prompt generation, and retrieval-augmented generation (RAG).
Classes
|
|
Agent
- class rakam_systems.generation.agents.Agent(model: str, api_key: str)
Bases:
ABCRepresents the agent that can perform different actions based on input and state.
- add_action(action_name: str, action: Action)
Adds an action to the agent’s set of available actions.
- Parameters:
action_name – A string name for the action (e.g., ‘rag_generation’).
action – An instance of an Action subclass.
- abstract choose_action(input: str, state: Any) Action
Abstract method to select an action based on input.
- Parameters:
input – A string input based on which the action is selected.
- Returns:
The selected Action instance.
Action
ClassifyQuery
- class rakam_systems.generation.agents.ClassifyQuery(agent, trigger_queries: Series, class_names: Series, embedding_model: str = 'all-MiniLM-L6-v2')
Bases:
ActionClassifies a query by finding the closest match in a vector store using FAISS and SentenceTransformers.
- build_vector_store(trigger_queries: Series, class_names: Series) VectorStores
Builds a VectorStores object from the trigger queries and class names.