doubao

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DOUBAO_EMBEDDING_EPID = os.Getenv("DOUBAO_EMBEDDING_EPID")
	DOUBAO_API_KEY        = os.Getenv("DOUBAO_API_KEY")
	ARK_NORMAL_EPID       = os.Getenv("ARK_NORMAL_EPID")
	ARK_REASON_EPID       = os.Getenv("ARK_REASON_EPID")
	ARK_VISION_EPID       = os.Getenv("ARK_VISION_EPID")

	NORMAL_MODEL_BOT_ID = os.Getenv("NORMAL_MODEL_BOT_ID")
	REASON_MODEL_BOT_ID = os.Getenv("REASON_MODEL_BOT_ID")
)

Functions

func EmbeddingText

func EmbeddingText(ctx context.Context, input string) (embedded []float32, tokenUsage model.Usage, err error)

EmbeddingText returns the embedding of the input text.

@param ctx
@param input
@return embedded
@return err

func GenerateChat

func GenerateChat(ctx context.Context, historyMsgList ...string) (answer string)

func SingleChat

func SingleChat(ctx context.Context, sysPrompt, userPrompt string) (string, error)

func SingleChatModel

func SingleChatModel(ctx context.Context, sysPrompt, userPrompt, modelID string) (string, error)

func SingleChatPrompt

func SingleChatPrompt(ctx context.Context, prompt string) (string, error)

func SingleChatStreamingPrompt

func SingleChatStreamingPrompt(ctx context.Context, sysPrompt, modelID string, files ...string) (iter.Seq[*ModelStreamRespReasoning], error)

Types

type ModelStreamRespReasoning

type ModelStreamRespReasoning struct {
	ReasoningContent string
	Content          string
}

Jump to

Keyboard shortcuts

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