Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
run: |
bash ./bin/publish-pypi
env:
PYPI_TOKEN: ${{ secrets.ARCADE_ENGINE_PYPI_TOKEN || secrets.PYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.ARCADE_AI_PYPI_TOKEN || secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
PYPI_TOKEN: ${{ secrets.ARCADE_ENGINE_PYPI_TOKEN || secrets.PYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.ARCADE_AI_PYPI_TOKEN || secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.1-alpha.0"
".": "0.1.0-alpha.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-5d0034cce7bb0c697f3ec08ab4d585002898a26e9e0e03f42ae2515f1cc56087.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-2f4d672c34ee530fb7290e2fb799d907aba7d9e47030659422f4e7760625be90.yml
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

## 0.1.0-alpha.1 (2024-10-13)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/ArcadeAI/arcade-py/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

### Features

* **api:** api update ([0f56d0a](https://github.com/ArcadeAI/arcade-py/commit/0f56d0afea70f6d778ab4778370926b0dc1a0158))
* **api:** api update ([13f9cc9](https://github.com/ArcadeAI/arcade-py/commit/13f9cc9c8bb3f9050f64f03f61d7f079052d4ffe))
* **api:** api update ([#1](https://github.com/ArcadeAI/arcade-py/issues/1)) ([af95dc6](https://github.com/ArcadeAI/arcade-py/commit/af95dc67b673b1562dc7aacd8acf4cdfb233f2c7))
* **api:** api update ([#3](https://github.com/ArcadeAI/arcade-py/issues/3)) ([d9fc13f](https://github.com/ArcadeAI/arcade-py/commit/d9fc13f43e09e7aab1df172355f2dc514bb02ca6))
* **api:** api update ([#4](https://github.com/ArcadeAI/arcade-py/issues/4)) ([3cc79b2](https://github.com/ArcadeAI/arcade-py/commit/3cc79b24ad5c0b1bb4787d6ce6fb65bb4cf62318))
* **api:** api update ([#5](https://github.com/ArcadeAI/arcade-py/issues/5)) ([9817f3b](https://github.com/ArcadeAI/arcade-py/commit/9817f3b0ecddd33fa73c4f47bcb68fa72e703ad4))
* **api:** api update ([#6](https://github.com/ArcadeAI/arcade-py/issues/6)) ([9b88f94](https://github.com/ArcadeAI/arcade-py/commit/9b88f9494d18f3e07f8fb3f5413bcd49277472e7))
* **api:** api update ([#7](https://github.com/ArcadeAI/arcade-py/issues/7)) ([ffc6078](https://github.com/ArcadeAI/arcade-py/commit/ffc60781dfd6567ed1a64961cdc728fb87f467a4))
* **api:** api update ([#8](https://github.com/ArcadeAI/arcade-py/issues/8)) ([f151213](https://github.com/ArcadeAI/arcade-py/commit/f15121316e4a4daa4a13c8b1b3dad6af68f3aa09))
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
$ pip install git+ssh://git@github.com/stainless-sdks/arcade-engine-python.git
$ pip install git+ssh://git@github.com/ArcadeAI/arcade-py.git
```

Alternatively, you can build from source and install the wheel file:
Expand Down Expand Up @@ -121,7 +121,7 @@ the changes aren't made through the automated pipeline, you may want to make rel

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/arcade-engine-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/ArcadeAI/arcade-py/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
71 changes: 55 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The REST API documentation can be found on [arcade-ai.com](https://arcade-ai.com
## Installation

```sh
# install from this staging repo
pip install git+ssh://git@github.com/stainless-sdks/arcade-engine-python.git
# install from the production repo
pip install git+ssh://git@github.com/ArcadeAI/arcade-py.git
```

> [!NOTE]
Expand All @@ -27,20 +27,23 @@ pip install git+ssh://git@github.com/stainless-sdks/arcade-engine-python.git
The full API of this library can be found in [api.md](api.md).

```python
import os
from arcadepy import ArcadeAI

client = ArcadeAI(
# This is the default and can be omitted
api_key=os.environ.get("ARCADE_API_KEY"),
# defaults to "production".
environment="staging",
)

response = client.tools.execute(
tool_response = client.tools.execute(
inputs="[object Object]",
tool_name="Google.ListEmails",
tool_version="0.1.0",
user_id="dev@arcade-ai.com",
user_id="user@example.com",
)
print(response.invocation_id)
print(tool_response.invocation_id)
```

While you can provide an `api_key` keyword argument,
Expand All @@ -53,23 +56,26 @@ so that your API Key is not stored in source control.
Simply import `AsyncArcadeAI` instead of `ArcadeAI` and use `await` with each API call:

```python
import os
import asyncio
from arcadepy import AsyncArcadeAI

client = AsyncArcadeAI(
# This is the default and can be omitted
api_key=os.environ.get("ARCADE_API_KEY"),
# defaults to "production".
environment="staging",
)


async def main() -> None:
response = await client.tools.execute(
tool_response = await client.tools.execute(
inputs="[object Object]",
tool_name="Google.ListEmails",
tool_version="0.1.0",
user_id="dev@arcade-ai.com",
user_id="user@example.com",
)
print(response.invocation_id)
print(tool_response.invocation_id)


asyncio.run(main())
Expand Down Expand Up @@ -102,7 +108,14 @@ from arcadepy import ArcadeAI
client = ArcadeAI()

try:
client.chat.completions()
client.chat.completions(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
],
)
except arcadepy.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
Expand Down Expand Up @@ -145,7 +158,14 @@ client = ArcadeAI(
)

# Or, configure per-request:
client.with_options(max_retries=5).chat.completions()
client.with_options(max_retries=5).chat.completions(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
],
)
```

### Timeouts
Expand All @@ -168,7 +188,14 @@ client = ArcadeAI(
)

# Override per-request:
client.with_options(timeout=5.0).chat.completions()
client.with_options(timeout=5.0).chat.completions(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
],
)
```

On timeout, an `APITimeoutError` is thrown.
Expand Down Expand Up @@ -207,16 +234,21 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from arcadepy import ArcadeAI

client = ArcadeAI()
response = client.chat.with_raw_response.completions()
response = client.chat.with_raw_response.completions(
messages=[{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}],
)
print(response.headers.get('X-My-Header'))

chat = response.parse() # get the object that `chat.completions()` would have returned
print(chat.id)
```

These methods return an [`APIResponse`](https://github.com/stainless-sdks/arcade-engine-python/tree/main/src/arcadepy/_response.py) object.
These methods return an [`APIResponse`](https://github.com/ArcadeAI/arcade-py/tree/main/src/arcadepy/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/arcade-engine-python/tree/main/src/arcadepy/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
The async client returns an [`AsyncAPIResponse`](https://github.com/ArcadeAI/arcade-py/tree/main/src/arcadepy/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand All @@ -225,7 +257,14 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

```python
with client.chat.with_streaming_response.completions() as response:
with client.chat.with_streaming_response.completions(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
],
) as response:
print(response.headers.get("X-My-Header"))

for line in response.iter_lines():
Expand Down Expand Up @@ -310,7 +349,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/arcade-engine-python/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/ArcadeAI/arcade-py/issues) with questions, bugs, or suggestions.

### Determining the installed version

Expand Down
24 changes: 15 additions & 9 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# Shared Types

```python
from arcadepy.types import AuthorizationResponse
from arcadepy.types import Error
```

# Auth

Types:

```python
from arcadepy.types import AuthorizationResponse
```

Methods:

- <code title="post /v1/auth/authorize">client.auth.<a href="./src/arcadepy/resources/auth.py">authorization</a>(\*\*<a href="src/arcadepy/types/auth_authorization_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/authorization_response.py">AuthorizationResponse</a></code>
- <code title="get /v1/auth/status">client.auth.<a href="./src/arcadepy/resources/auth.py">status</a>(\*\*<a href="src/arcadepy/types/auth_status_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/authorization_response.py">AuthorizationResponse</a></code>
- <code title="post /v1/auth/authorize">client.auth.<a href="./src/arcadepy/resources/auth.py">authorize</a>(\*\*<a href="src/arcadepy/types/auth_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/authorization_response.py">AuthorizationResponse</a></code>
- <code title="get /v1/auth/status">client.auth.<a href="./src/arcadepy/resources/auth.py">status</a>(\*\*<a href="src/arcadepy/types/auth_status_params.py">params</a>) -> <a href="./src/arcadepy/types/authorization_response.py">AuthorizationResponse</a></code>

# Chat

Types:

```python
from arcadepy.types import ChatResponse
from arcadepy.types import ChatMessage, ChatRequest, ChatResponse
```

Methods:
Expand All @@ -33,18 +39,18 @@ from arcadepy.types import HealthSchema

Methods:

- <code title="get /v1/health">client.health.<a href="./src/arcadepy/resources/health.py">list</a>() -> <a href="./src/arcadepy/types/health_schema.py">HealthSchema</a></code>
- <code title="get /v1/health">client.health.<a href="./src/arcadepy/resources/health.py">check</a>() -> <a href="./src/arcadepy/types/health_schema.py">HealthSchema</a></code>

# Tools

Types:

```python
from arcadepy.types import Definition, Response
from arcadepy.types import AuthorizeToolRequest, ExecuteToolRequest, ToolDefinition, ToolResponse
```

Methods:

- <code title="get /v1/tools/definition">client.tools.<a href="./src/arcadepy/resources/tools.py">retrieve</a>(\*\*<a href="src/arcadepy/types/tool_retrieve_params.py">params</a>) -> <a href="./src/arcadepy/types/definition.py">Definition</a></code>
- <code title="post /v1/tools/authorize">client.tools.<a href="./src/arcadepy/resources/tools.py">authorize</a>(\*\*<a href="src/arcadepy/types/tool_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/authorization_response.py">AuthorizationResponse</a></code>
- <code title="post /v1/tools/execute">client.tools.<a href="./src/arcadepy/resources/tools.py">execute</a>(\*\*<a href="src/arcadepy/types/tool_execute_params.py">params</a>) -> <a href="./src/arcadepy/types/response.py">Response</a></code>
- <code title="post /v1/tools/authorize">client.tools.<a href="./src/arcadepy/resources/tools.py">authorize</a>(\*\*<a href="src/arcadepy/types/tool_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/authorization_response.py">AuthorizationResponse</a></code>
- <code title="post /v1/tools/execute">client.tools.<a href="./src/arcadepy/resources/tools.py">execute</a>(\*\*<a href="src/arcadepy/types/tool_execute_params.py">params</a>) -> <a href="./src/arcadepy/types/tool_response.py">ToolResponse</a></code>
- <code title="get /v1/tools/definition">client.tools.<a href="./src/arcadepy/resources/tools.py">retrieve_definition</a>(\*\*<a href="src/arcadepy/types/tool_retrieve_definition_params.py">params</a>) -> <a href="./src/arcadepy/types/tool_definition.py">ToolDefinition</a></code>
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The ARCADE_ENGINE_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
errors+=("The ARCADE_AI_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "arcadepy"
version = "0.0.1-alpha.0"
version = "0.1.0-alpha.1"
description = "The official Python library for the Arcade AI API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -36,8 +36,8 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/stainless-sdks/arcade-engine-python"
Repository = "https://github.com/stainless-sdks/arcade-engine-python"
Homepage = "https://github.com/ArcadeAI/arcade-py"
Repository = "https://github.com/ArcadeAI/arcade-py"



Expand Down Expand Up @@ -123,7 +123,7 @@ path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# replace relative links with absolute links
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/stainless-sdks/arcade-engine-python/tree/main/\g<2>)'
replacement = '[\1](https://github.com/ArcadeAI/arcade-py/tree/main/\g<2>)'

[tool.black]
line-length = 120
Expand Down
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
],
"release-type": "python",
"extra-files": [
"src/arcade_engine/_version.py"
"src/arcadepy/_version.py"
]
}
Loading
Loading