JavaScript
import Riza from '@riza-io/api';
const client = new Riza({
apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});
const response = await client.tools.exec('id');
console.log(response.execution);import os
from rizaio import Riza
client = Riza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
)
response = client.tools.exec(
id="id",
)
print(response.execution)package main
import (
"context"
"fmt"
"github.com/riza-io/riza-api-go"
"github.com/riza-io/riza-api-go/option"
)
func main() {
client := riza.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RIZA_API_KEY")
)
response, err := client.Tools.Exec(
context.TODO(),
"id",
riza.ToolExecParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Execution)
}
{
"execution": {
"duration": 123,
"exit_code": 123,
"id": "<string>",
"stderr": "<string>",
"stdout": "<string>"
},
"output": "<unknown>",
"output_status": "error"
}{
"code": 16,
"message": "unauthenticated"
}Tools
Execute tool
Execute a tool with a given input. The input is validated against the tool’s input schema.
JavaScript
import Riza from '@riza-io/api';
const client = new Riza({
apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});
const response = await client.tools.exec('id');
console.log(response.execution);import os
from rizaio import Riza
client = Riza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
)
response = client.tools.exec(
id="id",
)
print(response.execution)package main
import (
"context"
"fmt"
"github.com/riza-io/riza-api-go"
"github.com/riza-io/riza-api-go/option"
)
func main() {
client := riza.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RIZA_API_KEY")
)
response, err := client.Tools.Exec(
context.TODO(),
"id",
riza.ToolExecParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Execution)
}
{
"execution": {
"duration": 123,
"exit_code": 123,
"id": "<string>",
"stderr": "<string>",
"stdout": "<string>"
},
"output": "<unknown>",
"output_status": "error"
}{
"code": 16,
"message": "unauthenticated"
}Authorizations
Body
application/json
Response
OK
The status of the output. "valid" means your Tool executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your Tool executed successfully, but returned a nonserializable object. "error" means your Tool failed to execute.
Available options:
error, json_serialization_error, valid