openai

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package openai implements analyzer.LLMClient against the OpenAI chat completions API

Index

Constants

View Source
const (

	// DefaultModel is used when config does not name one
	DefaultModel = "gpt-4o-mini"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an analyzer.LLMClient backed by the OpenAI API

func New

func New(cfg llm.Config) *Client

New builds a client. cfg.Model defaults to DefaultModel

func (*Client) Capabilities

func (c *Client) Capabilities() analyzer.ModelCapabilities

func (*Client) Complete

Complete sends one chat completion request. It never places req.System or req.User content anywhere but the message body OpenAI defines for it - the scanned content passed in as req.User gets no function/tool definitions, so the model has nothing to invoke, only text to judge.

func (*Client) Model

func (c *Client) Model() string

func (*Client) Name

func (c *Client) Name() string

Jump to

Keyboard shortcuts

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