Skip to content

Commit

Permalink
Merge pull request #55 from gizatechxyz/feature/add-agents
Browse files Browse the repository at this point in the history
Add agents to cli
  • Loading branch information
Gonmeso authored Apr 16, 2024
2 parents 6b341dd + 203c689 commit 39d9053
Show file tree
Hide file tree
Showing 23 changed files with 1,480 additions and 113 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,5 @@ smart_contracts/

.ruff_cache/
cairo_model/

.build/
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Giza CLI 0.14.1
description: Giza CLI 0.15.0
---

# Giza CLI
Expand Down
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [Versions](resources/versions.md)
* [Workspaces](resources/workspaces.md)
* [Endpoints](resources/endpoints.md)
* [Agents](resources/agents.md)

## 📚 Frameworks

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/full_transpilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pip install -r requirements.txt
Or:

```bash
pip install giza-cli==0.14.1 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
pip install giza-cli==0.15.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
```

We will use the libraries for the following purposes:
Expand Down
10 changes: 10 additions & 0 deletions docs/reference/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [`client`](./client.md#module-client)
- [`commands`](./commands.md#module-commands)
- [`commands.actions`](./commands.actions.md#module-commandsactions)
- [`commands.agents`](./commands.agents.md#module-commandsagents)
- [`commands.endpoints`](./commands.endpoints.md#module-commandsendpoints)
- [`commands.models`](./commands.models.md#module-commandsmodels)
- [`commands.prove`](./commands.prove.md#module-commandsprove)
Expand All @@ -32,6 +33,7 @@

## Classes

- [`client.AgentsClient`](./client.md#class-agentsclient): Client to interact with `agents` endpoint.
- [`client.ApiClient`](./client.md#class-apiclient): Implementation of the API client to interact with core-services
- [`client.EndpointsClient`](./client.md#class-endpointsclient): Client to interact with `endpoints` endpoint.
- [`client.EndpointsClient`](./client.md#class-endpointsclient): Client to interact with `endpoints` endpoint.
Expand Down Expand Up @@ -61,6 +63,11 @@
- [`callbacks.version_callback`](./callbacks.md#function-version_callback): Prints the current version when `--version` flag is added to a call.
- [`cli.entrypoint`](./cli.md#function-entrypoint)
- [`actions.new`](./commands.actions.md#function-new): This command will create a new action by generating a Python project.
- [`agents.create`](./commands.agents.md#function-create)
- [`agents.delete_agent`](./commands.agents.md#function-delete_agent)
- [`agents.get`](./commands.agents.md#function-get)
- [`agents.list`](./commands.agents.md#function-list)
- [`agents.update`](./commands.agents.md#function-update)
- [`endpoints.delete_endpoint`](./commands.endpoints.md#function-delete_endpoint)
- [`endpoints.deploy`](./commands.endpoints.md#function-deploy)
- [`endpoints.download_proof`](./commands.endpoints.md#function-download_proof)
Expand Down Expand Up @@ -105,5 +112,8 @@
- [`utils.get_response_info`](./utils.md#function-get_response_info): Utility to retrieve information of the client response.
- [`decorators.auth`](./utils.decorators.md#function-auth): Check that we have the token and it is not expired before executing
- [`misc.download_model_or_sierra`](./utils.misc.md#function-download_model_or_sierra): Download the model or sierra file.
- [`misc.get_ape_accounts`](./utils.misc.md#function-get_ape_accounts): Get the available APE accounts.
- [`misc.get_parameters_from_str`](./utils.misc.md#function-get_parameters_from_str): Get the parameters from a string.
- [`misc.load_json_file`](./utils.misc.md#function-load_json_file): Load a json file.
- [`misc.scarb_build`](./utils.misc.md#function-scarb_build): Build the scarb model.
- [`misc.zip_folder`](./utils.misc.md#function-zip_folder): Zip the folder to a specific location.
2 changes: 1 addition & 1 deletion docs/reference/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/cli.py#L206"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/cli.py#L214"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `entrypoint`

Expand Down
377 changes: 284 additions & 93 deletions docs/reference/api/client.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/api/commands.actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
## <kbd>function</kbd> `new`

```python
new(project_name: str = <typer.models.ArgumentInfo object at 0x1077e9850>)
new(project_name: str = <typer.models.ArgumentInfo object at 0x1043e6550>)
```

This command will create a new action by generating a Python project.
Expand Down
152 changes: 152 additions & 0 deletions docs/reference/api/commands.agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<!-- markdownlint-disable -->

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/agents.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

# <kbd>module</kbd> `commands.agents`




**Global Variables**
---------------
- **API_HOST**

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/agents.py#L21"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `create`

```python
create(
model_id: int = typer.Option(
None,
"--model-id",
"-m",
help="The ID of the model used to create the agent",
),
version_id: int = typer.Option(
None,
"--version-id",
"-v",
help="The ID of the version used to create the agent",
),
endpoint_id: int = typer.Option(
None,
"--endpoint-id",
"-e",
help="The ID of the endpoint used to create the agent",
),
name: Optional[str] = typer.Option(
None, "--name", "-n", help="The name of the agent"
),
description: Optional[str] = typer.Option(
None, "--description", "-d", help="The description of the agent"
),
debug: Optional[bool] = DEBUG_OPTION,
) → None
```






---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/agents.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `list`

```python
list(
parameters: Optional[List[str]] = typer.Option(
None, "--parameters", "-p", help="The parameters of the agent"
),
debug: Optional[bool] = DEBUG_OPTION,
) → None
```






---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/agents.py#L149"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get`

```python
get(
agent_id: int = typer.Option(
None,
"--agent-id",
"-a",
help="The ID of the agent",
),
debug: Optional[bool] = DEBUG_OPTION,
) → None
```






---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/agents.py#L173"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `delete_agent`

```python
delete_agent(
agent_id: int = typer.Option(
None,
"--agent-id",
"-a",
help="The ID of the agent",
),
debug: Optional[bool] = DEBUG_OPTION,
) → None
```






---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/agents.py#L197"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `update`

```python
update(
agent_id: int = typer.Option(
None,
"--agent-id",
"-a",
help="The ID of the agent",
),
name: Optional[str] = typer.Option(
None, "--name", "-n", help="The name of the agent"
),
description: Optional[str] = typer.Option(
None, "--description", "-d", help="The description of the agent"
),
parameters: Optional[List[str]] = typer.Option(
None, "--parameters", "-p", help="The parameters of the agent"
),
debug: Optional[bool] = DEBUG_OPTION,
) → None
```






6 changes: 3 additions & 3 deletions docs/reference/api/commands.endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ list_proofs(

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/endpoints.py#L245"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/endpoints.py#L241"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_proof`

Expand Down Expand Up @@ -169,7 +169,7 @@ get_proof(

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/endpoints.py#L294"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/endpoints.py#L290"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `download_proof`

Expand Down Expand Up @@ -203,7 +203,7 @@ download_proof(

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/endpoints.py#L353"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/endpoints.py#L347"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `list_jobs`

Expand Down
10 changes: 5 additions & 5 deletions docs/reference/api/commands.users.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L20"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L21"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `create`

Expand Down Expand Up @@ -41,7 +41,7 @@ Command to create a user. Asks for the new users information and validates the i

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L88"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L89"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `login`

Expand Down Expand Up @@ -70,7 +70,7 @@ Logs the current user into Giza. Under the hood this will retrieve the token for

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L137"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L138"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `create_api_key`

Expand Down Expand Up @@ -98,7 +98,7 @@ Create an API key for your user. You need to be logged in to create an API key.

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L181"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L182"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `me`

Expand All @@ -119,7 +119,7 @@ Retrieve information about the current user and print it as json to stdout.

---

<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L204"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/gizatechxyz/giza-cli/blob/main/giza/commands/users.py#L205"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `resend_email`

Expand Down
Loading

0 comments on commit 39d9053

Please sign in to comment.