eino

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package eino contains the Eino-backed chat model wrapper used by all AI agents in versus-incident. It is the ONLY package in the codebase that imports Eino's model package — every concrete AI agent (detect, analyze, ...) goes through this helper so a future framework swap only touches one file.

There is no `framework` knob in the config. Eino is the implementation; if operators need a different backend they bring it up here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChatModel

func NewChatModel(ctx context.Context, cfg config.AgentAIConfig, opts Options) (model.BaseChatModel, error)

NewChatModel builds an Eino ChatModel configured for JSON-mode structured output. cfg must already be the *resolved* per-task config (see AgentAIConfig.Resolve) — this helper does not look at the per-task sub-blocks.

Model must be set; APIKey may be empty (the OpenAI ACL client errors at call time, not construction time, which is fine for tests).

func NewToolCallingChatModel

func NewToolCallingChatModel(ctx context.Context, cfg config.AgentAIConfig, opts Options) (model.ToolCallingChatModel, error)

NewToolCallingChatModel mirrors NewChatModel but returns the tool-calling variant. The analyze agent needs WithTools to register its read-only tool catalog; detect uses the base helper above.

IMPORTANT: this helper deliberately does NOT force JSON-mode. With tools bound, the model alternates between tool_calls (JSON, never content) and a final assistant message; forcing JSON-mode causes providers to reject the tool-call turns.

Types

type Options

type Options struct {
	HTTPClient *http.Client
	BaseURL    string
	Timeout    time.Duration
}

BaseURL is overridable for tests. Production code passes "" to use the Eino / go-openai default (https://api.openai.com/v1). The agent admin endpoints never expose this; only the chatmodel test sets it to point at an httptest server.

Jump to

Keyboard shortcuts

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