NAME

WebService::Ollama::UA - HTTP client for Ollama

VERSION

Version 0.08

SYNOPSIS

use WebService::Ollama::UA;

my $ua = WebService::Ollama::UA->new(
    base_url => 'http://localhost:11434',
);

my $response = $ua->get(url => '/api/version');
my $response = $ua->post(url => '/api/chat', data => \%args);

DESCRIPTION

HTTP user agent for WebService::Ollama using LWP::UserAgent. Handles JSON encoding/decoding and response parsing.

METHODS

new

my $ua = WebService::Ollama::UA->new(
    base_url => 'http://localhost:11434',
);

get

my $response = $ua->get(url => '/api/version');

Perform a GET request.

post

my $response = $ua->post(url => '/api/chat', data => \%args);

Perform a POST request with JSON body.

delete

my $response = $ua->delete(url => '/api/delete', data => \%args);

Perform a DELETE request.

base64_images

my $images = $ua->base64_images(['path/to/image.png']);

Convert image files to base64 encoding for multimodal models.

AUTHOR

LNATION, <email at lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)