Skip to content

Commit

Permalink
fix(python-client): Reference PR #93
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts authored Jan 2, 2024
1 parent ecbffe0 commit 4ed64c6
Show file tree
Hide file tree
Showing 39 changed files with 5,874 additions and 4,902 deletions.
2 changes: 2 additions & 0 deletions packages/client/python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.openapi-generator/
agent_protocol_client_README.md
23 changes: 23 additions & 0 deletions packages/client/python/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
71 changes: 66 additions & 5 deletions packages/client/python/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Agent Communication Protocol - Python Client

Python client for Agent Communication Protocol. This client simplifies the communication with the agent.
# Agent Protocol - Python Client
![PyPI](https://img.shields.io/pypi/v/agent-protocol-client)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/agent-protocol-client)
![PyPI - Downloads](https://img.shields.io/pypi/dm/agent-protocol-client)

## Installation

Expand All @@ -10,6 +11,66 @@ pip install agent-protocol-client

## Getting Started

You can find simple usage in the example [here](./examples/minimal.py).
In your own code, to use this library to connect and interact with agent-protocol-client,
you can run the following:

```python

import time
import agent_protocol_client
from agent_protocol_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://0.0.0.0:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = agent_protocol_client.Configuration(
host = "http://0.0.0.0:8000"
)



# Enter a context with an instance of the API client
async with agent_protocol_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agent_protocol_client.AgentApi(api_client)
task_request_body = agent_protocol_client.TaskRequestBody() # TaskRequestBody | (optional)

try:
# Creates a task for the agent.
api_response = await api_instance.create_agent_task(task_request_body=task_request_body)
print("The response of AgentApi->create_agent_task:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AgentApi->create_agent_task: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *http://0.0.0.0:8000*

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


## Documentation For Models

For more functionalities look at the [API docs](./docs/AgentApi.md).
- [Artifact](agent_protocol_client/docs/Artifact.md)
- [GetAgentTask404Response](agent_protocol_client/docs/GetAgentTask404Response.md)
- [Pagination](agent_protocol_client/docs/Pagination.md)
- [Step](agent_protocol_client/docs/Step.md)
- [StepRequestBody](agent_protocol_client/docs/StepRequestBody.md)
- [Task](agent_protocol_client/docs/Task.md)
- [TaskArtifactsListResponse](agent_protocol_client/docs/TaskArtifactsListResponse.md)
- [TaskListResponse](agent_protocol_client/docs/TaskListResponse.md)
- [TaskRequestBody](agent_protocol_client/docs/TaskRequestBody.md)
- [TaskStepsListResponse](agent_protocol_client/docs/TaskStepsListResponse.md)
87 changes: 47 additions & 40 deletions packages/client/python/agent_protocol_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
# coding: utf-8

# flake8: noqa

"""
Agent Communication Protocol
Specification of the API protocol for communication with an agent. # noqa: E501
The version of the OpenAPI document: v0.2
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


__version__ = "1.0.0"

# import apis into sdk package
from agent_protocol_client.api.agent_api import AgentApi

# import ApiClient
from agent_protocol_client.api_response import ApiResponse
from agent_protocol_client.api_client import ApiClient
from agent_protocol_client.configuration import Configuration
from agent_protocol_client.exceptions import OpenApiException
from agent_protocol_client.exceptions import ApiTypeError
from agent_protocol_client.exceptions import ApiValueError
from agent_protocol_client.exceptions import ApiKeyError
from agent_protocol_client.exceptions import ApiAttributeError
from agent_protocol_client.exceptions import ApiException

# import models into sdk package
from agent_protocol_client.models.artifact import Artifact
from agent_protocol_client.models.step import Step
from agent_protocol_client.models.step_all_of import StepAllOf
from agent_protocol_client.models.step_request_body import StepRequestBody
from agent_protocol_client.models.task import Task
from agent_protocol_client.models.task_all_of import TaskAllOf
from agent_protocol_client.models.task_request_body import TaskRequestBody
# coding: utf-8

# flake8: noqa

"""
Agent Protocol
Specification of the API protocol for communication with an agent.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


__version__ = "1.1.0"

# import apis into sdk package
from agent_protocol_client.api.agent_api import AgentApi

# import ApiClient
from agent_protocol_client.api_response import ApiResponse
from agent_protocol_client.api_client import ApiClient
from agent_protocol_client.configuration import Configuration
from agent_protocol_client.exceptions import OpenApiException
from agent_protocol_client.exceptions import ApiTypeError
from agent_protocol_client.exceptions import ApiValueError
from agent_protocol_client.exceptions import ApiKeyError
from agent_protocol_client.exceptions import ApiAttributeError
from agent_protocol_client.exceptions import ApiException

# import models into sdk package
from agent_protocol_client.models.artifact import Artifact
from agent_protocol_client.models.get_agent_task404_response import (
GetAgentTask404Response,
)
from agent_protocol_client.models.pagination import Pagination
from agent_protocol_client.models.step import Step
from agent_protocol_client.models.step_request_body import StepRequestBody
from agent_protocol_client.models.task import Task
from agent_protocol_client.models.task_artifacts_list_response import (
TaskArtifactsListResponse,
)
from agent_protocol_client.models.task_list_response import TaskListResponse
from agent_protocol_client.models.task_request_body import TaskRequestBody
from agent_protocol_client.models.task_steps_list_response import TaskStepsListResponse
8 changes: 4 additions & 4 deletions packages/client/python/agent_protocol_client/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa

# import apis into api package
from agent_protocol_client.api.agent_api import AgentApi
# flake8: noqa

# import apis into api package
from agent_protocol_client.api.agent_api import AgentApi
Loading

0 comments on commit 4ed64c6

Please sign in to comment.