specialist

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataURI

func DataURI(path string) (string, error)

DataURI reads a file and returns a base64 data: URI (e.g. data:image/png;base64,...). Exported so the attachments package reuses it for native image parts.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client calls LocalAI's OpenAI-compatible specialist endpoints (transcription, vision description). baseURL is the LocalAI base, e.g. http://localhost:8080/v1.

func New

func New(baseURL, apiKey string) *Client

func (*Client) Describe

func (c *Client) Describe(ctx context.Context, path, model, prompt string) (string, error)

Describe turns an image into text by sending it to a vision model and returning the model's textual description.

It is the building block for the future Phase 2 `read_image` tool, which will let any agent (including a text-only one) pull an image into the conversation as model-generated text on demand. It is deliberately NOT wired into the attachment routing path: that path Blocks images on text-only models and nudges the user to switch to a vision model, rather than silently substituting a lossy AI-generated description for the actual image. (Audio, by contrast, auto-falls back to faithful transcription — see attachments.Route.) So Describe is intentionally ahead of its consumer in this branch.

func (*Client) DescribeVideo

func (c *Client) DescribeVideo(ctx context.Context, path, model, prompt string) (string, error)

DescribeVideo turns a video into text by sending it to a video-capable model (via a native video_url content part) and returning the model's textual description. Mirrors Describe; it is the building block for the read_video tool. Empty model ⇒ LocalAI's default chat model (which must support video input).

func (*Client) Transcribe

func (c *Client) Transcribe(ctx context.Context, path, model string) (string, error)

Transcribe uploads the audio file to {baseURL}/audio/transcriptions and returns the text. An empty model lets LocalAI pick the first FLAG_TRANSCRIPT model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL