service

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ERR_MODEL_DOES_NOT_SUPPORT_JSON_OBJECT = "model does not support json_object"

Variables

This section is empty.

Functions

func ConvertAnswerToString

func ConvertAnswerToString(value any) (string, error)

ConvertAnswerToString converts any value to string, handling both string and JSON marshaling

func ExecutePrompt

func ExecutePrompt(ctx context.Context, content string, parameters []string, parametersValues ExecutePromptParams) (string, error)

func ExtractAndValidateJSON

func ExtractAndValidateJSON(responseString string, chainConfig *gochains.BaseChain) (map[string]any, error)

func GenerateStructuredAnswer

func GenerateStructuredAnswer(
	ctx context.Context,
	chainConfig *gochains.BaseChain,
	params map[string]any,
	clientChan chan<- event.ProgressEvent,
) (map[string]any, error)

GenerateStructuredAnswer specifically returns structured responses

func GenerateTextAnswer

func GenerateTextAnswer(
	ctx context.Context,
	chainConfig *gochains.BaseChain,
	params map[string]any,
	clientChan chan<- event.ProgressEvent,
) (string, error)

GenerateTextAnswer specifically returns string responses (backwards compatible)

Types

type ExecutePromptParams

type ExecutePromptParams struct {
	Parameters map[string]string
}

type PromptExecutionService

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

func NewPromptExecutionService

func NewPromptExecutionService() *PromptExecutionService

type ScanState

type ScanState int
const (
	StateOut ScanState = iota
	StateIn
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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