internal

package
v0.9.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package internal provides adk internal utils.

Index

Constants

View Source
const EinoMsgIDKey = "_eino_msg_id"

EinoMsgIDKey is the Extra key used to store the eino-internal message ID.

Variables

This section is empty.

Functions

func EnsureMessageID added in v0.9.0

func EnsureMessageID(extra map[string]any) map[string]any

EnsureMessageID assigns a UUID v4 if no message ID is present. Idempotent: if ID already set, no-op. Returns the (possibly newly created) Extra map.

func GetMessageID added in v0.9.0

func GetMessageID(extra map[string]any) string

GetMessageID returns the message ID from Extra, or "" if not set. Works with any map[string]any (Message.Extra or AgenticMessage.Extra).

func SelectPrompt

func SelectPrompt(prompts I18nPrompts) string

SelectPrompt returns the appropriate prompt string based on the current language setting. Returns an error if the current language is not supported.

func SetLanguage

func SetLanguage(lang Language) error

SetLanguage sets the language for the ADK built-in prompts. The default language is English if not explicitly set.

func SetMessageID added in v0.9.0

func SetMessageID(extra map[string]any, id string) map[string]any

SetMessageID sets the message ID in Extra (initializing the map if nil). Returns the (possibly newly created) Extra map.

Types

type I18nPrompts

type I18nPrompts struct {
	English string
	Chinese string
}

I18nPrompts holds prompt strings for different languages.

type Language

type Language uint8

Language represents the language setting for the ADK built-in prompts.

const (
	// LanguageEnglish represents English language.
	LanguageEnglish Language = iota
	// LanguageChinese represents Chinese language.
	LanguageChinese
)

Jump to

Keyboard shortcuts

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