Skip to content
jmikedupont2 edited this page Aug 21, 2023 · 4 revisions

Overview

Introducing the Introspector Agent Task API 📝🤖

The Introspector Agent Task API is a groundbreaking interface that empowers intelligent agents to manage and execute tasks seamlessly. By distilling complex operations into intuitive symbols, this API revolutionizes the way agents interact with tasks, streamlining the process and enhancing efficiency.

📌 Key Features:

  1. Simplified Representation: The Task API employs symbolic representation to condense complex task-related information into easily digestible symbols, enabling agents to comprehend and interact with tasks effortlessly.

  2. Multi-Layered Abstraction: The API is organized into distinct layers, each representing a different aspect of task management. From resources and operations to request types and responses, the layers form a hierarchical structure for clear communication.

  3. Versatile Operations: Agents can perform a range of operations on tasks, including creation, retrieval, updating, and deletion. These operations are represented by intuitive symbols that eliminate ambiguity.

  4. Request Types: The API supports multiple request types, allowing agents to communicate their intentions clearly. Whether it's retrieving information or creating tasks, agents can choose from symbols that resonate with their goals.

  5. Comprehensive Responses: Agents receive responses in the form of symbols that convey the outcome of their operations. From success and warnings to errors, agents can quickly understand the status of their requests.

  6. Metadata Inclusion: Agents can attach essential metadata to tasks, including titles, descriptions, and version information. This metadata is represented symbolically, providing a comprehensive overview of each task.

🚀 Getting Started:

To harness the potential of the Introspector Agent Task API, developers can integrate it into their agent systems through a simple integration process:

  1. API Key Generation: Acquire an API key to authorize your agent's access to the Task API.

  2. API Endpoint: Establish a connection between your agent and the Task API using the provided API endpoint.

  3. Symbolic Communication: Utilize the symbolic representations to interact with tasks. Choose appropriate symbols for operations, request types, and metadata.

  4. Response Interpretation: Decode response symbols to understand the outcome of your agent's operations. Adapt your agent's behavior based on the received symbols.

  5. Enhanced Task Management: Leverage the Task API to enhance your agent's task management capabilities. Create, retrieve, update, and delete tasks with ease.

💡 Example Task Creation:

To illustrate the simplicity and power of the Introspector Agent Task API, consider the following example of task creation:

POST 📝  

📃 {
  "🏷️": "Prime Ticker",
  "📖": "Execute prime model...",
  
  "🚶‍♂️": [
    "🛠️ Setup ",
    "🦾 Fetch model",
    "⚙️ Run model",
    ...
  ] 
}

This concise representation encapsulates the endpoint, request type, body, title, description, and steps into symbolic form, minimizing the message size while conveying all essential details.

The Introspector Agent Task API empowers your agent to manage tasks efficiently, enabling streamlined communication and task execution. Elevate your agent's capabilities with the Task API and embark on a new era of intuitive task management! 📝🤖

#old PR for Source https://www.agentprotocol.ai/

Is your feature request related to a problem? Please describe. Certainly! Converting the YAML specification into Coq format requires defining the data structures and rules within the Coq programming language. Below is an approximate representation of the Agent API specification in Coq, including conversion and reduction rules. Note that this representation is simplified and may need further refinement to fit the complete Coq syntax and type definitions.

Inductive HttpMethod : Type :=
  | GET
  | POST.

Inductive HttpStatus : Type :=
  | Status200 : HttpStatus
  | Status404 : HttpStatus
  | StatusDefault : HttpStatus.

Inductive TaskStatus : Type :=
  | Created
  | Running
  | Completed.

Record Artifact : Type :=
  {
    artifact_id : string;
    file_name : string;
    relative_path : string
  }.

Record TaskInput : Type :=
  {
    input : string;
    additional_input : option TaskInput
  }.

Record StepInput : Type :=
  {
    input : string;
    additional_input : option StepInput
  }.

Record StepOutput : Type :=
  {
    tokens : nat;
    estimated_cost : string
  }.

Record Step : Type :=
  {
    step_id : string;
    task_id : string;
    name : string;
    status : TaskStatus;
    output : string;
    additional_output : option StepOutput;
    artifacts : list Artifact;
    is_last : bool
  }.

Record Task : Type :=
  {
    task_id : string;
    artifacts : list string
  }.

Inductive Path : Type :=
  | AgentTasks
  | AgentTasksWithId (task_id : string)
  | AgentTaskSteps (task_id : string)
  | AgentTaskStep (task_id step_id : string)
  | AgentTaskArtifacts (task_id : string)
  | AgentTaskArtifact (task_id artifact_id : string).

Record Endpoint : Type :=
  {
    path : Path;
    method : HttpMethod;
    summary : string;
    operationId : string;
    parameters : list string; (* Simplified parameter list *)
    requestBody : option TaskInput;
    responses : list (HttpStatus * option string) (* Simplified response description *)
  }.

(* Function to convert Coq data structures to emoji representations *)
Fixpoint coqToEmoji (s : string) : string :=
  (* Conversion logic here *)
  s.

(* Conversion rules *)
Definition convertEndpointToEmoji (ep : Endpoint) : string :=
  (* Apply conversion logic for each field in Endpoint *)

(* Reduction rules *)
Definition reduceEndpoint (ep : Endpoint) : Endpoint :=
  (* Apply reduction logic for each field in Endpoint *)

(* Example Endpoint *)
Definition exampleEndpoint : Endpoint :=
  {
    path := AgentTasks;
    method := POST;
    summary := "Creates a task for the agent.";
    operationId := "createAgentTask";
    parameters := ["task_id"];
    requestBody := Some (Build_TaskInput "Input prompt" None);
    responses := [(Status200, Some "A new agent task was successfully created.")]
  }.

(* Example usage *)
Definition exampleEmojiEndpoint := coqToEmoji (convertEndpointToEmoji exampleEndpoint).
Definition reducedExampleEndpoint := reduceEndpoint exampleEndpoint.
Definition reducedExampleEmojiEndpoint := coqToEmoji (convertEndpointToEmoji reducedExampleEndpoint).

📜 New Document: agent-api

🔓 OpenAPI: 3.0.1

ℹ️ Info:

  • 📚 Title: Agent Protocol
  • 📖 Description: Specification of the API protocol for communication with an agent.
  • 🔄 Version: 'v0.3'

🚀 Paths:

  • 📝 /agent/tasks:

    • POST:
      • 🔍 Summary: Creates a task for the agent.
      • 🏷️ Tags: [agent]
      • 💼 OperationId: createAgentTask
      • 📬 Request Body:
        • 📊 Content:
          • 📃 application/json:
            • 💠 Schema:
              • 💡 $ref: '#/components/schemas/TaskRequestBody'
      • 📯 Responses:
        • ✅ 200:
          • 🔍 Description: A new agent task was successfully created.
          • 📊 Content:
            • 📃 application/json:
              • 💠 Schema:
                • 💡 $ref: '#/components/schemas/Task'
        • ❌ default:
          • 🔍 Description: Internal Server Error
    • 🔍 GET:
      • ➕ Summary: List all tasks that have been created for the agent.
      • 🏷️ Tags: [agent]
      • 💼 OperationId: listAgentTasksIDs
      • 📯 Responses:
        • ✅ 200:
          • 🔍 Description: Returned list of agent's task IDs.
          • 📊 Content:
            • 📃 application/json:
              • 💠 Schema:
                • 📋 type: array
                • 💼 default: []
                • 📝 description: A list of task IDs
                • 🗂️ items:
                  • 📋 type: string
        • ❌ default:
          • 🔍 Description: Internal Server Error
  • 📝 /agent/tasks/{task_id}:

    • 🔍 GET:

      • ➕ Summary: Get details about a specified agent task.
      • 🏷️ Tags: [agent]
      • 💼 OperationId: getAgentTask
      • 📝 Parameters:
        • 📁 - name: task_id
          • 📦 in: path
          • 📋 description: ID of the task
          • 🚻 required: true
          • 💠 Schema:
            • 📋 type: string
      • 📯 Responses:
        • ✅ 200:
          • 🔍 Description: Returned details about an agent task.
          • 📊 Content:
            • 📃 application/json:
              • 💠 Schema:
                • 💡 $ref: '#/components/schemas/Task'
        • ✅ 404:
          • 🔍 Description: Task not found.
        • ❌ default:
          • 🔍 Description: Internal Server Error
    • 🔄 /agent/tasks/{task_id}/steps:

      • 🔍 GET:
        • ➕ Summary: List all steps for the specified task.
        • 🏷️ Tags: [agent]
        • 💼 OperationId: listAgentTaskSteps
        • 📝 Parameters:
          • 📁 - name: task_id
            • 📦 in: path
            • 📋 description: ID of the task
            • 🚻 required: true
            • 💠 Schema:
              • 📋 type: string
        • 📯 Responses:
          • ✅ 200:
            • 🔍 Description: Returned list of agent's step IDs for the specified task.
            • 📊 Content:
              • 📃 application/json:
                • 💠 Schema:
                  • 📋 type: array
                  • 💼 default: []
                  • 📝 description: A list of step IDs for the task
                  • 🗂️ items:
                    • 📋 type: string
          • ✅ 404:
            • 🔍 Description: Task not found.
          • ❌ default:
            • 🔍 Description: Internal Server Error
        • POST:
          • 🔍 Summary: Execute a step in the specified agent task.
          • 🏷️ Tags: [agent]
          • 💼 OperationId: executeAgentTaskStep
          • 📝 Parameters:
            • 📁 - name: task_id
              • 📦 in: path
              • 📋 description: ID of the task
              • 🚻 required: true
              • 💠 Schema:
                • 📋 type: string
          • 📬 Request Body:
            • 📊 Content:
              • 📃 application/json:
                • 💠 Schema:
                  • 💡 $ref: '#/components/schemas/StepRequestBody'
          • 📯 Responses:
            • ✅ 200:
              • 🔍 Description: Executed step for the agent task.
              • 📊 Content:
                • 📃 application/json:
                  • 💠 Schema:
                    • 💡 $ref: '#/components/schemas/Step'
            • ✅ 404:
              • 🔍 Description: Task not found.
            • ❌ default:
              • 🔍 Description: Internal Server Error
    • 📂 /agent/tasks/{task_id}/steps/{step_id}:

      • 🔍 GET:
        • ➕ Summary: Get details about a specified task step.
        • 🏷️ Tags: [agent]
        • 💼 OperationId: getAgentTaskStep
        • 📝 Parameters:
          • 📁 - name: task_id
            • 📦 in: path
            • 📋 description: ID of the task
            • 🚻 required: true
            • 💠 Schema:
              • 📋 type: string
          • 📁 - name: step_id
            • 📦 in: path
            • 📋 description: ID of the step
            • 🚻 required: true
            • 💠 Schema:
              • 📋 type: string
        • 📯 Responses:
          • ✅ 200:
            • 🔍 Description: Returned details about an agent task step.
            • 📊 Content:
              • 📃 application/json:
                • 💠 Schema:
                  • 💡 $ref: '#/components/schemas/Step'
          • ✅ 404:
            • 🔍 Description: Task or step not found.
          • ❌ default:
            • 🔍 Description: Internal Server Error
    • 🔍 /agent/tasks/{task_id}/artifacts:

      • 🔍 GET:
        • ➕ Summary: List all artifacts that have been created for the given task.
        • 🏷️ Tags: [agent]
        • 💼 OperationId: listAgentTaskArtifacts
        • 📝 Parameters:
          • 📁 - name: task_id
            • 📦 in: path
            • 📋 description: ID of the task
            • 🚻 required: true
            • 💠 Schema:
              • 📋 type: string
        • 📯 Responses:
          • ✅ 200:
            • 🔍 Description: Returned the content of the artifact.
            • 📊 Content:
              • 📃 application/json:
                • 💠 Schema:
                  • 📋 type: array
                  • 💼 default: []
                  • 📝 description: A list of artifacts for the task
                  • 🗂️ items:
                    • 💠 $ref: '#/components/schemas/Artifact'
          • ✅ 404:
            • 🔍 Description: Task not found.
          • ❌ default:
            • 🔍 Description: Internal Server Error
        • POST:
          • 🔍 Summary: Upload an artifact for the specified task.
          • 🏷️ Tags: [agent]
          • 💼 OperationId: uploadAgentTaskArtifacts
          • 📬 Request Body:
            • 📊 Content:
              • 📂 multipart/form-data:
                • 💠 Schema:
                  • 💡 $ref: '#/components/schemas/ArtifactUpload'
          • 📝 Parameters:
            • 📁 - name: task_id
              • 📦 in: path
              • 📋 description: ID of the task
              • 🚻 required: true
              • 💠 Schema:
                • 📋 type: string
          • 📯 Responses:
            • ✅ 200:
              • 🔍 Description: Returned the content of the artifact.
              • 📊 Content:
                • 📃 application/json:
                  • 💠 Schema:
                    • 💡 $ref: '#/components/schemas/Artifact'
            • ✅ 404:
              • 🔍 Description: Task not found.
            • ❌ default:
              • 🔍 Description: Internal Server Error
    • 📁 /agent/tasks/{task_id}/artifacts/{artifact_id}:

      • 🔍 GET:
        • ➕ Summary: Download a specified artifact.
        • 🏷️ Tags: [agent]
        • 💼 OperationId: downloadAgentTaskArtifact
        • 📝 Parameters:
          • 📁 - name: task_id
            • 📦 in: path
            • 📋 description: ID of the task
            • 🚻 required: true
            • 💠 Schema:
              • 📋 type: string
          • 📁 - name: artifact_id
            • 📦 in: path
            • 📋 description: ID of the artifact
            • 🚻 required: true
            • 💠 Schema:
              • 📋 type: string
        • 📯 Responses:
          • ✅ 200:
            • 🔍 Description: Returned the content of the artifact.
            • 📊 Content:
              • 📂 application/octet-stream:
                • 💠 Schema:
                  • 📋 type: string
                  • 💥 format: binary
          • ✅ 404:
            • 🔍 Description: Task or artifact not found.
          • ❌ default:
            • 🔍 Description: Internal Server Error

📋 Components:

  • 🧩 Schemas:
    • 💡 TaskInput:
      • 📋 Description: Input parameters for the task. Any value is allowed.
      • 📋 Example: "{\n"debug": false,\n"mode": "benchmarks"\n}"
    • 🧭 Artifact:
      • 📋 Type: object
      • ✅ Required:
        • 📋 - 'artifact_id'
        • 📋 - 'file_name'
      • 📋 Description: Artifact that the task has produced.
      • 📋 Properties:
        • 📋 artifact_id:
          • 📋 Description: ID of the artifact.
          • 📋 Type: string
          • 📋 Example: 'b225e278-8b4c-4f99-a696-8facf19f0e56'
        • 📋 file_name:
          • 📋 Description: Filename of the artifact.
          • 📋 Type: string
          • 📋 Example: 'main.py'
        • 📋 relative_path:
          • 📋 Description: Relative path of the artifact in the agent's workspace.
          • 📋 Type: string
          • 📋 Example: 'python/code/'
    • 📦 ArtifactUpload:
      • 📋 Type: object
      • ✅ Required:
        • 📋 - 'file'
      • 📋 Description: Artifact to upload to the agent.
      • 📋 Properties:
        • 📋 file:
          • 📋 Description: File to upload.
          • 📋 Type: string
          • 💥 Format: binary
        • 📋 relative_path:
          • 📋 Description: Relative path of the artifact in the agent's workspace.
          • 📋 Type: string
          • 📋 Example: 'python/code'
    • 🧩 StepInput:
      • 📋 Description: Input parameters for the task step. Any value is allowed.
      • 📋 Example: "{\n"file_to_refactor": "models.py"\n}"
    • 🧭 StepOutput:
      • 📋 Description: Output that the task step has produced. Any value is allowed.
      • 📋 Example: "{\n"tokens": 7894,\n"estimated_cost": "0,24$"\n}"
    • 📦 TaskRequestBody:
      • 📋 Type: object
      • 📋 Description: Body of the task request.
      • 📋 Properties:
        • 📋 input:
          • 📋 Description: Input prompt for the task.
          • 📋 Type: string
          • 📋 Example: "Write the words you receive to the file 'output.txt'."
        • 📋 additional_input:
          • 💡 $ref: '#/components/schemas/TaskInput'
    • 💼 Task:
      • 🔗 allOf:
        • 💡 $ref: '#/components/schemas/TaskRequestBody'
        • 📋 Type: object
        • ✅ Required:
          • 📋 - 'task_id'
          • 📋 - 'artifacts'
        • 📋 Properties:
          • 📋 task_id:
            • 📋 Description: The ID of the task.
            • 📋 Type: string
            • 📋 Example: '50da533e-3904-4401-8a07-c49adf88b5eb'
          • 📋 artifacts:
            • 📋 Type: array
            • 📋 Example: ['7a49f31c-f9c6-4346-a22c-e32bc5af4d8e', 'ab7b4091-2560-4692-a4

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here. fe-d831ea3ca7d6'] - 💼 default: [] - 📋 Description: A list of artifacts that the task has produced. - 🗂️ items: - 💠 $ref: '#/components/schemas/Artifact'

  • 💼 StepRequestBody:
    • 📋 Type: object
    • 📋 Description: Body of the task request.
    • 📋 Properties:
      • 📋 input:
        • 📋 Description: Input prompt for the step.
        • 📋 Example: 'Washington'
        • 📋 Type: string
      • 📋 additional_input:
        • 💡 $ref: '#/components/schemas/StepInput'
  • 📦 Step:
    • 🔗 allOf:
      • 💡 $ref: '#/components/schemas/StepRequestBody'
      • 📋 Type: object
      • ✅ Required:
        • 📋 - 'step_id'
        • 📋 - 'task_id'
        • 📋 - 'status'
        • 📋 - 'artifacts'
      • 📋 Properties:
        • 📋 task_id:
          • 📋 Description: The ID of the task this step belongs to.
          • 📋 Type: string
          • 📋 Example: '50da533e-3904-4401-8a07-c49adf88b5eb'
        • 📋 step_id:
          • 📋 Description: The ID of the task step.
          • 📋 Type: string
          • 📋 Example: '6bb1801a-fd80-45e8-899a-4dd723cc602e'
        • 📋 name:
          • 📋 Description: The name of the task step.
          • 📋 Type: string
          • 📋 Example: 'Write to file'
        • 📋 status:
          • 📋 Description: The status of the task step.
          • 📋 Type: string
          • 📋 Enum:
            • 📋 - 'created'
            • 📋 - 'running'
            • 📋 - 'completed'
        • 📋 output:
          • 📋 Type: string
          • 📋 Description: Output of the task step.
          • 📋 Example: "I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')"
        • 📋 additional_output:
          • 💡 $ref: '#/components/schemas/StepOutput'
        • 📋 artifacts:
          • 📋 Type: array
          • 💼 default: []
          • 📋 Description: A list of artifacts that the step has produced.
          • 🗂️ items:
            • 💠 $ref: '#/components/schemas/Artifact'
        • 📋 is_last:
          • 📋 Description: Whether this is the last step in the task.
          • 📋 Type: boolean
          • 💼 default: false
Clone this wiki locally