RevelryAI.V2.Skill (RevelryAI v0.3.0)

Copy Markdown View Source

Handles v2 skill execution for the RevelryAI API.

Runs a skill asynchronously without creating an artifact. The endpoint returns an api_job_id immediately; poll for the result with RevelryAI.V2.ApiJob.get/2 or RevelryAI.V2.ApiJob.await/2.

Summary

Functions

run(skill_id, project_id, params, config \\ [])

@spec run(
  integer(),
  integer(),
  %{
    :inputs => [%{name: String.t(), value: String.t()}],
    optional(:model_configuration_id) => integer()
  },
  Keyword.t()
) :: {:ok, map()} | {:error, term()}

Runs a skill asynchronously.

Parameters

  • skill_id: the ID of the skill to run
  • project_id: the ID of the project to run the skill in
  • params: the request body:
    • inputs (required): a list of %{name: name, value: value} maps matching the skill's custom variables
    • model_configuration_id (optional): overrides the organization's default model configuration
  • config (optional): a configuration keyword list used to override default config values

Example

iex> RevelryAI.V2.Skill.run(10, 1, %{
...>   inputs: [
...>     %{name: "Context", value: "this is a test"}
...>   ]
...> })
{:ok,
 %{
   status: "ok",
   response: %{
     "api_job_id" => 42,
     "message" => "Skill execution started."
   }
 }}

Returns

Returns {:ok, response} as soon as execution is enqueued (HTTP 202). Use the returned api_job_id with RevelryAI.V2.ApiJob.get/2 or RevelryAI.V2.ApiJob.await/2 to retrieve the result.