Action Prompt
Action Prompt provides the interface for Active Agent to render prompt contexts using Action View templates. Similarly to Action Mailers that render mail messages that are delivered through configured delivery methods, Action Prompt integrates with Generation Providers through the generation module. This allows for dynamic content generation and the ability to use Rails helpers and partials within the prompt templates as well as rendering content from performed actions. Empowering developers with a powerful way to create interactive and engaging user experiences.
Prompt-generation equest-Response Cycle
The prompt-generation cycle is similar to the request-response cycle of Action Controller and is at the core of the Active Agent framework. It involves the following steps:
- Prompt Context: The Prompt object is created with the necessary context, including messages, actions, and parameters.
- Generation Request: The agent sends a request to the generation provider with the prompt context, including the messages and actions.
- Generation Response: The generation provider processes the request and returns a response, which is then passed back to the agent.
- Response Handling: The agent processes the response which can be sent back to the user or used for further processing.
- Action Execution: If the response includes actions, the agent executes them and updates the context accordingly.
- Updated Context: The context is updated with the new messages, actions, and parameters, and the cycle continues.
Prompt Context
Action Prompt renders prompt context objects that represent the contextual data and runtime parameters for the generation process. Prompt context objects contain messages, actions, and params that are passed in the request to the agent's generation provider. The context object is responsible for managing the contextual history and providing the necessary information for prompt and response cycles.