Tools
List Tools
Lists all workspace tools. By default, returns all tools in a single response. Setlimit to enable cursor-based pagination with starting_after and ending_before.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.list(limit=300)
# Handle response
print(res)
Show Parameters
Show Parameters
Maximum number of tools per page (1-200). Omit to return all tools.
A cursor for use in pagination.
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Create a Tool
Creates a new tool in the workspace.import orq_ai_sdk
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.create(request=orq_ai_sdk.RequestBodyJSONSchemaTool(
path="Default",
key="<key>",
description="runway border pro mortally recount accredit promptly",
status="live",
type="json_schema",
json_schema=orq_ai_sdk.RequestBodyJSONSchema(
name="<value>",
description="lovable past madly uh-huh by",
schema_=orq_ai_sdk.RequestBodySchema(
type="<value>",
properties={
"key": "<value>",
},
required=[],
),
),
))
# Handle response
print(res)
Show Parameters
Show Parameters
The request object to use for the request.
Update a Tool
Updates a tool in the workspace.import orq_ai_sdk
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.update(tool_id="<id>", request_body=orq_ai_sdk.UpdateFunctionTool(
path="Default",
status="live",
type="function",
))
# Handle response
print(res)
Show Parameters
Show Parameters
Delete a Tool
Deletes a tool by key.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.tools.delete(tool_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
The request object to use for the request.
Retrieve a Tool
Retrieves a tool by id.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.retrieve(tool_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
The request object to use for the request.
Tools Versions
Returns version history for a specific toolfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.get_v2_tools_tool_id_versions(tool_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10
A cursor for use in pagination.
starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with 01JJ1HDHN79XAS7A01WB3HYSDB, your subsequent call can include after=01JJ1HDHN79XAS7A01WB3HYSDB in order to fetch the next page of the list.Show Response
Show Response
Tools Versions
Returns a specific version of a toolfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.get_v2_tools_tool_id_versions_version_id_(tool_id="<id>", version_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters