provider

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package provider 抽象模型调用节点,换模型/多模型路由均通过实现本接口扩展。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelChunkHandler

type ModelChunkHandler func(chunk types.ModelChunk) error

ModelChunkHandler 接收流式增量;返回 error 可提前取消流。

type ModelProvider

type ModelProvider interface {
	Invoke(ctx context.Context, req *types.ModelRequest) (*types.ModelResponse, error)
}

ModelProvider 是非流式模型调用。

type StreamProvider

type StreamProvider interface {
	Stream(ctx context.Context, req *types.ModelRequest, onChunk ModelChunkHandler) (*types.ModelResponse, error)
}

StreamProvider 是流式模型调用,聚合出完整响应后返回。WithStreaming 启用时优先于 Invoke。

Jump to

Keyboard shortcuts

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