Agents - Document - Writer / Reviewer

This task creates a temporary document and simulates two agents that write on the document. Agent A reviews a document that is stored in memory. Agent B creates or improves the document based on the review and last document.

Input

Description

This task creates a temporary document and simulates two agents that write on the document. Agent A reviews a document that is stored in memory. Agent B creates or improves the document based on the review and last document.

You start by setting the Overwrite document variable to TODO: Write document here. This creates a document named by the "Session storage" variable, that is edited. This is only done in the first execution.

The Reviewer Agent reviews the current document regarding the goal. The Writer Agent uses the current document and the review by the Reviewer agent to improve the document. After every execution the document gets improved. You can create a PDF if specified in the 'Agent task - writer' variable that a latex document should be created.

Applications

The task simulates a collaborative document review and writing process between two agents, enabling iterative improvement of the document.

How to use it

  1. Set "Overwrite document" variable to "TODO: Write document here" (first execution only).

  2. The Reviewer Agent reviews the document with a specific goal in mind.

  3. The Writer Agent uses the review and previous document to improve the content.

  4. Repeat the process for iterative document refinement.

  5. Optionally, create a PDF using LaTeX if specified in the 'Agent task - writer' variable.

[1.0.0]:
First version
VersionAI ModelCreatedLink
1.0.021.06.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • duration_h (Document lifetime (h)): How many hours the document is stored. (less = cheaper)
  • session (Document name): Defines in which session the data is stored. you can think of it as a temporary file name.
  • role_a (Agent role name - writer): The role name of the first agent that work on the document.
  • role_b (Agent role name - reviewer): The role name of the second agent that reviews the document.
  • role_b_task (Agent task - reviewer): The task of the reviewer agent.
  • role_a_task (Agent task - writer): The task of the worker agent.
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/u-ba835df8268fc301-agents--writer--reviewer/1.0.0?duration_h=3&session=425afad0-41c1-40d1-9e81-82105d19a4e7&role_a=Senior%20Text%20Writer&role_b=Senior%20Publishing%20Editor&role_b_task=Review%20the%20text%20and%20return%20notes%20about%20what%20should%20be%20improved.&role_a_task=Write%20a%20paper%20about%20whether%20to%20allow%20a%20wolve%20population%20in%20Germany.
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('u-ba835df8268fc301-agents--writer--reviewer','1.0.0', {'duration_h': '3', 'session': '425afad0-41c1-40d1-9e81-82105d19a4e7', 'role_a': 'Senior Text Writer', 'role_b': 'Senior Publishing Editor', 'role_b_task': 'Review the text and return notes about what should be improved.', 'role_a_task': 'Write a paper about whether to allow a wolve population in Germany.'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('u-ba835df8268fc301-agents--writer--reviewer','1.0.0', duration_h='3', session='425afad0-41c1-40d1-9e81-82105d19a4e7', role_a='Senior Text Writer', role_b='Senior Publishing Editor', role_b_task='Review the text and return notes about what should be improved.', role_a_task='Write a paper about whether to allow a wolve population in Germany.')