Writer AI Agent¶
Writer AI Agent
is a third‑party agent from Writer.com that uses a defined input schema to handle writing tasks. It specializes in generating, refining, and structuring content based on user input, leveraging integrated tools and customizable guidelines to support content planning, drafting, and iterative editing.
Use the AI Refinery SDK and the WriterAIAgent
class to integrate your Writer AI Agent.
Creating Writer AI Agent ¶
To set up an AI Refinery project with a WriterAIAgent
, follow these steps:
-
Obtain your API key and applicaion ID from Writer AI Studio:
- Log in to the platform at
https://dev.writer.com/
. - Click Build an agent, then choose API to create a new agent.
- Copy the Application ID once the agent is created, which is a UUID string.
- Navigate to API Keys, find the Production key, and click Reveal key to display
<your-writer-api-key>
. - Store this value as you environment variable.
- Log in to the platform at
-
Configure
api_key_env_var
andapplication_id
in your YAML configuration for AI Refinery
Onboarding Writer AI Agent¶
To use the Writer AI agents through our AI Refinery SDK, users need the following parameters:
Variable | Description |
---|---|
api_key_env_var |
Name of the environment variable storing your Writer.com API key. |
application_id |
Unique identifier for your Writer AI Agent provided by Writer.com. |
wait_time |
(Optional) Maximum time in seconds to wait for a response. |
contexts |
Allows for the provision of additional information during communication with the Writer AI Agent . |
Workflow Overview¶
The workflow of the WriterAIAgent
class consists of six components:
- Initialization
An agent is created in Writer AI Studio and registered in AI Refinery with theapi_key_env_var
andapplication_id
(see Usage and Quickstart). - Requesting Input Schema
AI Refinery requests the input schema from the Writer AI Agent. - Preparing Input Schema
The Writer AI Agent returns its input schema, and AI Refinery structures the request according to that schema. - Sending a Structured Prompt
AI Refinery sends a schema‑compliant writing prompt to the Writer AI Agent. - Processing
The Writer AI Agent uses its language model, built‑in utilities (e.g., grammar checking, summarization), and an optional knowledge base to generate content. - Receiving the Response
The Writer AI Agent returns a schema‑based output to AI Refinery for further integration.
Usage and Quickstart¶
To quickly set up an AI Refinery project with a WriterAIAgent
, the user should first obtain their credentials from the Writer. Once the credentials are available, use the YAML configuration template below to integrate it into the AI Refinery project.
Specifically, ensure the following configurations are included:
- Add a utility agent with
agent_class: SalesforceAgent
underutility_agents
. - Ensure the
agent_name
you chose for yourSalesforceAgent
is listed in theagent_list
underorchestrator
.
Template YAML Configuration of WriterAIAgent
¶
See the YAML template below for the WriterAIAgent
configuration.
orchestrator:
agent_list:
- agent_name: <your-agent-name> # Required, the name you choose for your WriterAIAgent
utility_agents:
- agent_class: WriterAIAgent # Required and be "WriterAIAgent" for communication with user-established Writer AI Agent
agent_name: <your-agent-name> # Required, the name you choose for your WriterAIAgent
agent_description: <brief description of functionality> # Optional yet essential description of the utility agent outlining its functions.
config:
api_key_env_var: "WRITER_AUTH_TOKEN" # Required for authentication, the name of the environment variable
application_id: <real-writer-application-id> # Required to access the unique application, actual ID from Writer.
wait_time: 300 # Optional timeout in seconds
contexts: # Optional additional agent contexts
- "date"
- "chat_history"
With this configuration, the WriterAIAgent
will receive prompts, generate structured outputs, and return them to AI Refinery for further processing or workflow integration.