Documentation
¶
Index ¶
- Constants
- func StripMarkdownCodeBlocks(s string) string
- type Client
- func (c *Client) AnalyzeImage(ctx context.Context, imageData []byte, altText string) (summary string, tags []string, err error)
- func (c *Client) ExtractContent(ctx context.Context, rawText string) (string, error)
- func (c *Client) ExtractTextFromImage(ctx context.Context, imageData []byte) (string, error)
- func (c *Client) Generate(ctx context.Context, prompt string) (string, error)
- func (c *Client) GenerateWithVision(ctx context.Context, prompt string, imageData []byte) (string, error)
- func (c *Client) ScoreContent(ctx context.Context, url string, title string, content string) (score float64, reason string, categories []string, ...)
Constants ¶
const ( DefaultBaseURL = "http://localhost:11434" DefaultModel = "llama3.2" DefaultTimeout = 120 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func StripMarkdownCodeBlocks ¶
StripMarkdownCodeBlocks removes markdown code block wrappers from a string This handles cases like ```json\n{...}\n``` and returns just the {...} content
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with Ollama
func NewClientWithVisionModel ¶
NewClientWithVisionModel creates a new Ollama client with separate vision model
func (*Client) AnalyzeImage ¶
func (c *Client) AnalyzeImage(ctx context.Context, imageData []byte, altText string) (summary string, tags []string, err error)
AnalyzeImage uses Ollama vision to generate a summary and tags for an image
func (*Client) ExtractContent ¶
ExtractContent uses Ollama to extract meaningful content from HTML text
func (*Client) ExtractTextFromImage ¶
ExtractTextFromImage uses Ollama vision to perform OCR and extract text from an image
func (*Client) GenerateWithVision ¶
func (c *Client) GenerateWithVision(ctx context.Context, prompt string, imageData []byte) (string, error)
GenerateWithVision sends a vision request to Ollama with an image
func (*Client) ScoreContent ¶
func (c *Client) ScoreContent(ctx context.Context, url string, title string, content string) (score float64, reason string, categories []string, maliciousIndicators []string, err error)
ScoreContent analyzes content and assigns a quality score for ingestion Returns a score (0.0-1.0), reason, categories, and malicious indicators