Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 Update #66

Merged
merged 15 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/js-sdk-lint.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/js-sdk-publish.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/python-sdk-publish.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ Right now the protocol is defined as a REST API (via the
[OpenAPI spec](./schemas/openapi.yml)) with two essential routes for interaction with
your agent:

- `POST /agent/tasks` for creating a new task for the agent (for example giving
- `POST /ap/v1/agent/tasks` for creating a new task for the agent (for example giving
the agent an objective that you want to accomplish)
- `POST /agent/tasks/{task_id}/steps` for executing one step of the defined task
- `POST /ap/v1/agent/tasks/{task_id}/steps` for executing one step of the defined task

It has also a few additional routes for listing the tasks, steps and downloading / uploading artifacts.

Expand Down
18 changes: 9 additions & 9 deletions client/python/agent_protocol_client/api/agent_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def create_agent_task_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks",
"/ap/v1/agent/tasks",
"POST",
_path_params,
_query_params,
Expand Down Expand Up @@ -383,7 +383,7 @@ def download_agent_task_artifact_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}/artifacts/{artifact_id}",
"/ap/v1/agent/tasks/{task_id}/artifacts/{artifact_id}",
"GET",
_path_params,
_query_params,
Expand Down Expand Up @@ -571,7 +571,7 @@ def execute_agent_task_step_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}/steps",
"/ap/v1/agent/tasks/{task_id}/steps",
"POST",
_path_params,
_query_params,
Expand Down Expand Up @@ -738,7 +738,7 @@ def get_agent_task_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}",
"/ap/v1/agent/tasks/{task_id}",
"GET",
_path_params,
_query_params,
Expand Down Expand Up @@ -918,7 +918,7 @@ def get_agent_task_step_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}/steps/{step_id}",
"/ap/v1/agent/tasks/{task_id}/steps/{step_id}",
"GET",
_path_params,
_query_params,
Expand Down Expand Up @@ -1087,7 +1087,7 @@ def list_agent_task_artifacts_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}/artifacts",
"/ap/v1/agent/tasks/{task_id}/artifacts",
"GET",
_path_params,
_query_params,
Expand Down Expand Up @@ -1256,7 +1256,7 @@ def list_agent_task_steps_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}/steps",
"/ap/v1/agent/tasks/{task_id}/steps",
"GET",
_path_params,
_query_params,
Expand Down Expand Up @@ -1405,7 +1405,7 @@ def list_agent_tasks_ids_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks",
"/ap/v1/agent/tasks",
"GET",
_path_params,
_query_params,
Expand Down Expand Up @@ -1632,7 +1632,7 @@ def upload_agent_task_artifacts_with_http_info(
}

return self.api_client.call_api(
"/agent/tasks/{task_id}/artifacts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we move those version into an env variable? So that future changes can be easier?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We likely can, yes. I want to move the client into its own repository as well.

"/ap/v1/agent/tasks/{task_id}/artifacts",
"POST",
_path_params,
_query_params,
Expand Down
18 changes: 9 additions & 9 deletions client/python/agent_protocol_client/docs/AgentApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ All URIs are relative to _http://localhost_

| Method | HTTP request | Description |
| ---------------------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------- |
| [**create_agent_task**](AgentApi.md#create_agent_task) | **POST** /agent/tasks | Creates a task for the agent. |
| [**download_agent_task_artifact**](AgentApi.md#download_agent_task_artifact) | **GET** /agent/tasks/{task_id}/artifacts/{artifact_id} | Download a specified artifact. |
| [**execute_agent_task_step**](AgentApi.md#execute_agent_task_step) | **POST** /agent/tasks/{task_id}/steps | Execute a step in the specified agent task. |
| [**get_agent_task**](AgentApi.md#get_agent_task) | **GET** /agent/tasks/{task_id} | Get details about a specified agent task. |
| [**get_agent_task_step**](AgentApi.md#get_agent_task_step) | **GET** /agent/tasks/{task_id}/steps/{step_id} | Get details about a specified task step. |
| [**list_agent_task_artifacts**](AgentApi.md#list_agent_task_artifacts) | **GET** /agent/tasks/{task_id}/artifacts | List all artifacts that have been created for the given task. |
| [**list_agent_task_steps**](AgentApi.md#list_agent_task_steps) | **GET** /agent/tasks/{task_id}/steps | List all steps for the specified task. |
| [**list_agent_tasks_ids**](AgentApi.md#list_agent_tasks_ids) | **GET** /agent/tasks | List all tasks that have been created for the agent. |
| [**upload_agent_task_artifacts**](AgentApi.md#upload_agent_task_artifacts) | **POST** /agent/tasks/{task_id}/artifacts | Upload an artifact for the specified task. |
| [**create_agent_task**](AgentApi.md#create_agent_task) | **POST** /ap/v1/agent/tasks | Creates a task for the agent. |
| [**download_agent_task_artifact**](AgentApi.md#download_agent_task_artifact) | **GET** /ap/v1/agent/tasks/{task_id}/artifacts/{artifact_id} | Download a specified artifact. |
| [**execute_agent_task_step**](AgentApi.md#execute_agent_task_step) | **POST** /ap/v1/agent/tasks/{task_id}/steps | Execute a step in the specified agent task. |
| [**get_agent_task**](AgentApi.md#get_agent_task) | **GET** /ap/v1/agent/tasks/{task_id} | Get details about a specified agent task. |
| [**get_agent_task_step**](AgentApi.md#get_agent_task_step) | **GET** /ap/v1/agent/tasks/{task_id}/steps/{step_id} | Get details about a specified task step. |
| [**list_agent_task_artifacts**](AgentApi.md#list_agent_task_artifacts) | **GET** /ap/v1/agent/tasks/{task_id}/artifacts | List all artifacts that have been created for the given task. |
| [**list_agent_task_steps**](AgentApi.md#list_agent_task_steps) | **GET** /ap/v1/agent/tasks/{task_id}/steps | List all steps for the specified task. |
| [**list_agent_tasks_ids**](AgentApi.md#list_agent_tasks_ids) | **GET** /ap/v1/agent/tasks | List all tasks that have been created for the agent. |
| [**upload_agent_task_artifacts**](AgentApi.md#upload_agent_task_artifacts) | **POST** /ap/v1/agent/tasks/{task_id}/artifacts | Upload an artifact for the specified task. |

# **create_agent_task**

Expand Down
8 changes: 4 additions & 4 deletions docs/src/app/clients/others/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const url = 'http://localhost:8000'
const body = JSON.stringify({ input: 'task-input-to-your-agent' })

// Create task
let response = await fetch(`${url}/agent/tasks`, { method: 'POST' }, { body })
let response = await fetch(`${url}/ap/v1/agent/tasks`, { method: 'POST' }, { body })
let data = await response.json()

const taskId = data.task_id
let isLast = false

// Execute steps until the completion
while (!isLast) {
response = await fetch(`${url}/agent/tasks/${taskId}/steps`, {
response = await fetch(`${url}/ap/v1/agent/tasks/${taskId}/steps`, {
method: 'POST',
})
data = await response.json()
Expand All @@ -46,7 +46,7 @@ To **create a task** run

```sh
curl --request POST \
--url http://localhost:8000/agent/tasks \
--url http://localhost:8000/ap/v1/agent/tasks \
--header 'Content-Type: application/json' \
--data '{
"input": "task-input-to-your-agent"
Expand All @@ -68,7 +68,7 @@ previous request and run:

```sh
curl --request POST \
--url http://localhost:8000/agent/tasks/<task-id>/steps
--url http://localhost:8000/ap/v1/agent/tasks/<task-id>/steps
```

To get response like this:
Expand Down
Loading