Arcade Gateway (#401)
Updating the CLI and Docs to say "gateway" not "engine". I didn't touch the code
This commit is contained in:
parent
e764205e6c
commit
bd1d75970d
6 changed files with 35 additions and 35 deletions
|
|
@ -105,7 +105,7 @@ try calling the GitHub.SetStarred tool with a message like "Star the arcade-ai r
|
||||||
|
|
||||||
=== Arcade Chat ===
|
=== Arcade Chat ===
|
||||||
|
|
||||||
Chatting with Arcade Engine at https://api.arcade.dev
|
Chatting with Arcade Gateway at https://api.arcade.dev
|
||||||
|
|
||||||
User sam@arcade.dev:
|
User sam@arcade.dev:
|
||||||
star the arcadeai/arcade-ai repo
|
star the arcadeai/arcade-ai repo
|
||||||
|
|
@ -252,10 +252,10 @@ arcade worker rm demo-worker
|
||||||
|
|
||||||
Once deployed, your toolkit is immediately available through the Arcade platform. You can now call your tools through the playground, LLM API, or Tools API without any additional setup.
|
Once deployed, your toolkit is immediately available through the Arcade platform. You can now call your tools through the playground, LLM API, or Tools API without any additional setup.
|
||||||
|
|
||||||
For local development and testing when running the Arcade Engine locally or tunneling to it, you can
|
For local development and testing when running the Arcade Gateway locally or tunneling to it, you can
|
||||||
use `arcade serve` to host your toolkit locally and connect it to the Arcade Engine.
|
use `arcade serve` to host your toolkit locally and connect it to the Arcade Gateway.
|
||||||
|
|
||||||
If you are running the Arcade Engine locally, go to localhost:9099 (or other local address)
|
If you are running the Arcade Gateway locally, go to localhost:9099 (or other local address)
|
||||||
and add the worker address in the "workers" page.
|
and add the worker address in the "workers" page.
|
||||||
|
|
||||||
## Calling your tools
|
## Calling your tools
|
||||||
|
|
|
||||||
|
|
@ -164,13 +164,13 @@ def show(
|
||||||
PROD_ENGINE_HOST,
|
PROD_ENGINE_HOST,
|
||||||
"-h",
|
"-h",
|
||||||
"--host",
|
"--host",
|
||||||
help="The Arcade Engine address to show the tools/toolkits of.",
|
help="The Arcade Gateway address to show the tools/toolkits of.",
|
||||||
),
|
),
|
||||||
local: bool = typer.Option(
|
local: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--local",
|
"--local",
|
||||||
"-l",
|
"-l",
|
||||||
help="Show the local environment's catalog instead of an Arcade Engine's catalog.",
|
help="Show the local environment's catalog instead of an Arcade Gateway's catalog.",
|
||||||
),
|
),
|
||||||
port: Optional[int] = typer.Option(
|
port: Optional[int] = typer.Option(
|
||||||
None,
|
None,
|
||||||
|
|
@ -181,12 +181,12 @@ def show(
|
||||||
force_tls: bool = typer.Option(
|
force_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--tls",
|
"--tls",
|
||||||
help="Whether to force TLS for the connection to the Arcade Engine. If not specified, the connection will use TLS if the engine URL uses a 'https' scheme.",
|
help="Whether to force TLS for the connection to the Arcade Gateway. If not specified, the connection will use TLS if the Gateway URL uses a 'https' scheme.",
|
||||||
),
|
),
|
||||||
force_no_tls: bool = typer.Option(
|
force_no_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--no-tls",
|
"--no-tls",
|
||||||
help="Whether to disable TLS for the connection to the Arcade Engine.",
|
help="Whether to disable TLS for the connection to the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
debug: bool = typer.Option(False, "--debug", "-d", help="Show debug information"),
|
debug: bool = typer.Option(False, "--debug", "-d", help="Show debug information"),
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
@ -211,23 +211,23 @@ def chat(
|
||||||
PROD_ENGINE_HOST,
|
PROD_ENGINE_HOST,
|
||||||
"-h",
|
"-h",
|
||||||
"--host",
|
"--host",
|
||||||
help="The Arcade Engine address to send chat requests to.",
|
help="The Arcade Gateway address to send chat requests to.",
|
||||||
),
|
),
|
||||||
port: int = typer.Option(
|
port: int = typer.Option(
|
||||||
None,
|
None,
|
||||||
"-p",
|
"-p",
|
||||||
"--port",
|
"--port",
|
||||||
help="The port of the Arcade Engine.",
|
help="The port of the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
force_tls: bool = typer.Option(
|
force_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--tls",
|
"--tls",
|
||||||
help="Whether to force TLS for the connection to the Arcade Engine. If not specified, the connection will use TLS if the engine URL uses a 'https' scheme.",
|
help="Whether to force TLS for the connection to the Arcade Gateway. If not specified, the connection will use TLS if the gateway URL uses a 'https' scheme.",
|
||||||
),
|
),
|
||||||
force_no_tls: bool = typer.Option(
|
force_no_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--no-tls",
|
"--no-tls",
|
||||||
help="Whether to disable TLS for the connection to the Arcade Engine.",
|
help="Whether to disable TLS for the connection to the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
@ -346,28 +346,28 @@ def evals(
|
||||||
LOCALHOST,
|
LOCALHOST,
|
||||||
"-h",
|
"-h",
|
||||||
"--host",
|
"--host",
|
||||||
help="The Arcade Engine address to send chat requests to.",
|
help="The Arcade Gateway address to send chat requests to.",
|
||||||
),
|
),
|
||||||
cloud: bool = typer.Option(
|
cloud: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--cloud",
|
"--cloud",
|
||||||
help="Whether to run evaluations against the Arcade Cloud Engine. Overrides the 'host' option.",
|
help="Whether to run evaluations against the Arcade Cloud Gateway. Overrides the 'host' option.",
|
||||||
),
|
),
|
||||||
port: int = typer.Option(
|
port: int = typer.Option(
|
||||||
None,
|
None,
|
||||||
"-p",
|
"-p",
|
||||||
"--port",
|
"--port",
|
||||||
help="The port of the Arcade Engine.",
|
help="The port of the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
force_tls: bool = typer.Option(
|
force_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--tls",
|
"--tls",
|
||||||
help="Whether to force TLS for the connection to the Arcade Engine. If not specified, the connection will use TLS if the engine URL uses a 'https' scheme.",
|
help="Whether to force TLS for the connection to the Arcade Gateway. If not specified, the connection will use TLS if the gateway URL uses a 'https' scheme.",
|
||||||
),
|
),
|
||||||
force_no_tls: bool = typer.Option(
|
force_no_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--no-tls",
|
"--no-tls",
|
||||||
help="Whether to disable TLS for the connection to the Arcade Engine.",
|
help="Whether to disable TLS for the connection to the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
@ -387,12 +387,12 @@ def evals(
|
||||||
|
|
||||||
console.print(
|
console.print(
|
||||||
Text.assemble(
|
Text.assemble(
|
||||||
("\nRunning evaluations against Arcade Engine at ", "bold"),
|
("\nRunning evaluations against Arcade Gateway at ", "bold"),
|
||||||
(base_url, "bold blue"),
|
(base_url, "bold blue"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Try to hit /health endpoint on engine and warn if it is down
|
# Try to hit /health endpoint on gateway and warn if it is down
|
||||||
with Arcade(api_key=config.api.key, base_url=base_url) as client:
|
with Arcade(api_key=config.api.key, base_url=base_url) as client:
|
||||||
log_engine_health(client)
|
log_engine_health(client)
|
||||||
|
|
||||||
|
|
@ -587,23 +587,23 @@ def deploy(
|
||||||
PROD_ENGINE_HOST,
|
PROD_ENGINE_HOST,
|
||||||
"--host",
|
"--host",
|
||||||
"-h",
|
"-h",
|
||||||
help="The Arcade Engine host to register the worker to.",
|
help="The Arcade Gateway host to register the worker to.",
|
||||||
),
|
),
|
||||||
port: int = typer.Option(
|
port: int = typer.Option(
|
||||||
None,
|
None,
|
||||||
"--port",
|
"--port",
|
||||||
"-p",
|
"-p",
|
||||||
help="The port of the Arcade Engine host.",
|
help="The port of the Arcade Gateway host.",
|
||||||
),
|
),
|
||||||
force_tls: bool = typer.Option(
|
force_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--tls",
|
"--tls",
|
||||||
help="Whether to force TLS for the connection to the Arcade Engine. If not specified, the connection will use TLS if the engine URL uses a 'https' scheme.",
|
help="Whether to force TLS for the connection to the Arcade Gateway. If not specified, the connection will use TLS if the gateway URL uses a 'https' scheme.",
|
||||||
),
|
),
|
||||||
force_no_tls: bool = typer.Option(
|
force_no_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--no-tls",
|
"--no-tls",
|
||||||
help="Whether to disable TLS for the connection to the Arcade Engine.",
|
help="Whether to disable TLS for the connection to the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
@ -645,13 +645,13 @@ def dashboard(
|
||||||
PROD_ENGINE_HOST,
|
PROD_ENGINE_HOST,
|
||||||
"-h",
|
"-h",
|
||||||
"--host",
|
"--host",
|
||||||
help="The Arcade Engine host that serves the dashboard.",
|
help="The Arcade Gateway host that serves the dashboard.",
|
||||||
),
|
),
|
||||||
port: Optional[int] = typer.Option(
|
port: Optional[int] = typer.Option(
|
||||||
None,
|
None,
|
||||||
"-p",
|
"-p",
|
||||||
"--port",
|
"--port",
|
||||||
help="The port of the Arcade Engine.",
|
help="The port of the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
local: bool = typer.Option(
|
local: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
|
|
@ -662,17 +662,17 @@ def dashboard(
|
||||||
force_tls: bool = typer.Option(
|
force_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--tls",
|
"--tls",
|
||||||
help="Whether to force TLS for the connection to the Arcade Engine.",
|
help="Whether to force TLS for the connection to the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
force_no_tls: bool = typer.Option(
|
force_no_tls: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--no-tls",
|
"--no-tls",
|
||||||
help="Whether to disable TLS for the connection to the Arcade Engine.",
|
help="Whether to disable TLS for the connection to the Arcade Gateway.",
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Opens the Arcade Dashboard in a web browser.
|
"""Opens the Arcade Dashboard in a web browser.
|
||||||
|
|
||||||
The Dashboard is a web-based Arcade user interface that is served by the Arcade Engine.
|
The Dashboard is a web-based Arcade user interface that is served by the Arcade Gateway.
|
||||||
"""
|
"""
|
||||||
if local:
|
if local:
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
|
|
|
||||||
|
|
@ -55,15 +55,15 @@ docker compose up
|
||||||
|
|
||||||
This command will build and start all the services defined in the `docker-compose.yml` file and make their ports available to your host machine.
|
This command will build and start all the services defined in the `docker-compose.yml` file and make their ports available to your host machine.
|
||||||
|
|
||||||
### 4. Verify the Engine is Running
|
### 4. Verify the Gateway is Running
|
||||||
|
|
||||||
In a separate terminal window, check if the engine is running:
|
In a separate terminal window, check if the gateway is running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl http://localhost:9099/v1/health
|
curl http://localhost:9099/v1/health
|
||||||
```
|
```
|
||||||
|
|
||||||
You should receive a response indicating that the engine is healthy:
|
You should receive a response indicating that the gateway is healthy:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{ "status": "healthy" }
|
{ "status": "healthy" }
|
||||||
|
|
@ -108,7 +108,7 @@ docker compose up
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- **Engine Health Check Fails**: Ensure that all environment variables are correctly set in the `.env` file and that the services have started without errors.
|
- **Gateway Health Check Fails**: Ensure that all environment variables are correctly set in the `.env` file and that the services have started without errors.
|
||||||
- **Port Conflicts**: If the default ports are already in use, modify the ports in the `docker-compose.yml` file.
|
- **Port Conflicts**: If the default ports are already in use, modify the ports in the `docker-compose.yml` file.
|
||||||
- **Authentication Errors**: Double-check the client IDs and secrets provided for auth providers.
|
- **Authentication Errors**: Double-check the client IDs and secrets provided for auth providers.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ if __name__ == "__main__":
|
||||||
cloud_host = "https://api.arcade.dev"
|
cloud_host = "https://api.arcade.dev"
|
||||||
|
|
||||||
client = Arcade(
|
client = Arcade(
|
||||||
base_url=cloud_host, # Alternatively, use http://localhost:9099 if you are running Arcade Engine locally, or any base_url if you're hosting elsewhere
|
base_url=cloud_host, # Alternatively, use http://localhost:9099 if you are running Arcade Gateway locally, or any base_url if you're hosting elsewhere
|
||||||
)
|
)
|
||||||
|
|
||||||
user_id = "you@example.com"
|
user_id = "you@example.com"
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ def call_auth_tool(client: Arcade, user_id: str) -> None:
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
client = Arcade(
|
client = Arcade(
|
||||||
base_url="https://api.arcade.dev", # Alternatively, use http://localhost:9099 if you are running Arcade Engine locally, or any base_url if you're hosting elsewhere
|
base_url="https://api.arcade.dev", # Alternatively, use http://localhost:9099 if you are running Arcade Gateway locally, or any base_url if you're hosting elsewhere
|
||||||
)
|
)
|
||||||
|
|
||||||
user_id = "you@example.com"
|
user_id = "you@example.com"
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
openai_client = OpenAI(
|
openai_client = OpenAI(
|
||||||
api_key=arcade_api_key,
|
api_key=arcade_api_key,
|
||||||
base_url=cloud_host, # Alternatively, use http://localhost:9099/v1 if you are running Arcade Engine locally
|
base_url=cloud_host, # Alternatively, use http://localhost:9099/v1 if you are running Arcade Gateway locally
|
||||||
)
|
)
|
||||||
|
|
||||||
chat_result = call_tool_with_openai(openai_client)
|
chat_result = call_tool_with_openai(openai_client)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue