Galya
Agents

Agent tools

Each REST method maps to a galya_* tool so models can call Galya from an OpenAI-style function-calling loop. Use openAiFunctionTools() for the schema and executeGalyaAgentTool() to dispatch—no manual URL wiring.

import {
  GalyaApiClient,
  openAiFunctionTools,
  executeGalyaAgentTool,
} from "@galya/agents";

const api = new GalyaApiClient({ apiKey: "…", workspaceId: "ws_…" });
const tools = openAiFunctionTools();

// when the model returns a tool_call:
await executeGalyaAgentTool(api, "galya_search", {
  relative_to_entity_id: "ent_…",
  in_terms_of_entity_type: "content",
  query: "warm minimal living room",
});

Tool args are snake_case (relative_to_entity_id); the TypeScript client uses camelCase—the executor translates.

Available tools: galya_search, galya_rerank, galya_ask, galya_explain, galya_index_content, galya_index_content_batch, plus entity and cluster helpers. Requires a secret API key—not galya_pub_….