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 tool = await client.tools.create({ code: 'code', language: 'python', name: 'name' });
console.log(tool.id);import os
from rizaio import Riza
client = Riza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
)
tool = client.tools.create(
code="code",
language="python",
name="name",
)
print(tool.id)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")
)
tool, err := client.Tools.New(context.TODO(), riza.ToolNewParams{
Code: riza.F("code"),
Language: riza.F(riza.ToolNewParamsLanguagePython),
Name: riza.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", tool.ID)
}
{
"code": "<string>",
"description": "<string>",
"id": "<string>",
"input_schema": "<unknown>",
"language": "python",
"name": "<string>",
"revision_id": "<string>",
"runtime_revision_id": "<string>"
}{
"code": 16,
"message": "unauthenticated"
}Tools
Create tool
Create a tool in your project.
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 tool = await client.tools.create({ code: 'code', language: 'python', name: 'name' });
console.log(tool.id);import os
from rizaio import Riza
client = Riza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
)
tool = client.tools.create(
code="code",
language="python",
name="name",
)
print(tool.id)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")
)
tool, err := client.Tools.New(context.TODO(), riza.ToolNewParams{
Code: riza.F("code"),
Language: riza.F(riza.ToolNewParamsLanguagePython),
Name: riza.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", tool.ID)
}
{
"code": "<string>",
"description": "<string>",
"id": "<string>",
"input_schema": "<unknown>",
"language": "python",
"name": "<string>",
"revision_id": "<string>",
"runtime_revision_id": "<string>"
}{
"code": 16,
"message": "unauthenticated"
}Authorizations
Body
application/json
Response
OK