Zoonk.AI.AIClient (Zoonk v0.1.0-dev)
View SourcePublic client for generating AI content across various services.
This module provides a unified interface for interacting with different AI services.
It delegates requests to the appropriate service based on the model specified.
Summary
Functions
Generates structured output from an AI service based on the given payload.
Functions
Generates structured output from an AI service based on the given payload.
Takes a Zoonk.AI.AIPayload
struct containing the model, messages, and schema configuration.
Delegates to the appropriate client based on the model specified.
Examples
iex> payload = %AIPayload{model: "gpt-4", schema: schema, messages: messages}
iex> AIClient.generate_object(payload)
{:ok, %{field: "value"}}
iex> AIClient.generate_object(%AIPayload{model: "unsupported"})
{:error, "Unsupported model"}