Skip to main content

liteforge

函数名函数描述/介绍
liteforge.Execute
liteforge.actionliteforge.action is an option for liteforge.Execute it sets the action type for the liteforge execution, example: ``` liteforge.Execute(<<<P...
liteforge.analyzeCtx
liteforge.analyzeLog
liteforge.analyzeStatusCard
liteforge.contextliteforge.context is an option for liteforge.Execute it sets the context for the liteforge execution example: ``` liteforge.Execute(<<<PROMP...
liteforge.forceImageliteforge.forceImage is an option for liteforge.Execute it forces the execution to require image input example: ``` liteforge.Execute(<<<PRO...
liteforge.idliteforge.id is an option for liteforge.Execute it sets the ID for the liteforge instance example: ``` liteforge.Execute(<<<PROMPT SOME_CONT...
liteforge.imageliteforge.image is an option for liteforge.Execute it adds image data to the execution context example: ``` liteforge.Execute(<<<PROMPT SOME...
liteforge.imageExtraPrompt
liteforge.imageFileliteforge.imageFile is an option for liteforge.Execute it adds image files to the execution context example: ``` liteforge.Execute(<<<PROMPT...
liteforge.knowledgeBaseDesc
liteforge.knowledgeBaseName
liteforge.knowledgeBaseType
liteforge.knowledgeEntryLength
liteforge.outputliteforge.output is an option for liteforge.Execute it can limit the output of the liteforge.Execute use jsonschema.ActionObject to limit the output...
liteforge.refinePrompt
liteforge.speedPriorityliteforge.speedPriority uses a faster/cheaper AI model for distillation tasks
liteforge.strictRefine
liteforge.verboseNameliteforge.verboseName is an option for liteforge.Execute it adds verbose naming options to the execution example: ``` liteforge.Execute(<<<P...

函数定义#

Execute#

详细描述#

定义#

Execute(query string, opts ...any) (*ForgeResult, error)

参数#

参数名参数类型参数解释
querystring
opts...any

返回值#

返回值(顺序)返回值类型返回值解释
r1*ForgeResult
r2error

action#

详细描述#

liteforge.action is an option for liteforge.Execute it sets the action type for the liteforge execution,

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.action("analyze"))

定义#

action(action string) LiteForgeExecOption

参数#

参数名参数类型参数解释
actionstring

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

analyzeCtx#

详细描述#

定义#

analyzeCtx(ctx context.Context) AnalysisOption

参数#

参数名参数类型参数解释
ctxcontext.Context

返回值#

返回值(顺序)返回值类型返回值解释
r1AnalysisOption

analyzeLog#

详细描述#

定义#

analyzeLog(handler func(format string, args ...any)) AnalysisOption

参数#

参数名参数类型参数解释
handlerfunc(format string, args ...any)

返回值#

返回值(顺序)返回值类型返回值解释
r1AnalysisOption

analyzeStatusCard#

详细描述#

定义#

analyzeStatusCard(handler func(id string, data any, tags ...string)) AnalysisOption

参数#

参数名参数类型参数解释
handlerfunc(id string, data any, tags ...string)

返回值#

返回值(顺序)返回值类型返回值解释
r1AnalysisOption

context#

详细描述#

liteforge.context is an option for liteforge.Execute it sets the context for the liteforge execution

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.context(ctx))

定义#

context(ctx context.Context) LiteForgeExecOption

参数#

参数名参数类型参数解释
ctxcontext.Context

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

forceImage#

详细描述#

liteforge.forceImage is an option for liteforge.Execute it forces the execution to require image input

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.forceImage(true))

定义#

forceImage(force ...bool) LiteForgeExecOption

参数#

参数名参数类型参数解释
force...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

id#

详细描述#

liteforge.id is an option for liteforge.Execute it sets the ID for the liteforge instance

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.id("my-forge-instance"))

定义#

id(id string) LiteForgeExecOption

参数#

参数名参数类型参数解释
idstring

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

image#

详细描述#

liteforge.image is an option for liteforge.Execute it adds image data to the execution context

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.image(imageData))

定义#

image(anyImageInput ...any) LiteForgeExecOption

参数#

参数名参数类型参数解释
anyImageInput...any

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

imageExtraPrompt#

详细描述#

定义#

imageExtraPrompt(prompt string) AnalysisOption

参数#

参数名参数类型参数解释
promptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1AnalysisOption

imageFile#

详细描述#

liteforge.imageFile is an option for liteforge.Execute it adds image files to the execution context

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.imageFile("path/to/image.jpg"))

定义#

imageFile(filename ...string) LiteForgeExecOption

参数#

参数名参数类型参数解释
filename...string

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

knowledgeBaseDesc#

详细描述#

定义#

knowledgeBaseDesc(desc string) RefineOption

参数#

参数名参数类型参数解释
descstring

返回值#

返回值(顺序)返回值类型返回值解释
r1RefineOption

knowledgeBaseName#

详细描述#

定义#

knowledgeBaseName(name string) RefineOption

参数#

参数名参数类型参数解释
namestring

返回值#

返回值(顺序)返回值类型返回值解释
r1RefineOption

knowledgeBaseType#

详细描述#

定义#

knowledgeBaseType(typ string) RefineOption

参数#

参数名参数类型参数解释
typstring

返回值#

返回值(顺序)返回值类型返回值解释
r1RefineOption

knowledgeEntryLength#

详细描述#

定义#

knowledgeEntryLength(length int) RefineOption

参数#

参数名参数类型参数解释
lengthint

返回值#

返回值(顺序)返回值类型返回值解释
r1RefineOption

output#

详细描述#

liteforge.output is an option for liteforge.Execute it can limit the output of the liteforge.Execute use jsonschema.ActionObject to limit the output to an object

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTNPROMPT, liteforge.output(jsonschema.ActionObject(jsonschema.paramString("value"))),

定义#

output(output string) LiteForgeExecOption

参数#

参数名参数类型参数解释
outputstring

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

refinePrompt#

详细描述#

定义#

refinePrompt(prompt string) RefineOption

参数#

参数名参数类型参数解释
promptstring

返回值#

返回值(顺序)返回值类型返回值解释
r1RefineOption

speedPriority#

详细描述#

liteforge.speedPriority uses a faster/cheaper AI model for distillation tasks

定义#

speedPriority(b ...bool) LiteForgeExecOption

参数#

参数名参数类型参数解释
b...bool

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption

strictRefine#

详细描述#

定义#

strictRefine(strict bool) RefineOption

参数#

参数名参数类型参数解释
strictbool

返回值#

返回值(顺序)返回值类型返回值解释
r1RefineOption

verboseName#

详细描述#

liteforge.verboseName is an option for liteforge.Execute it adds verbose naming options to the execution

example:

liteforge.Execute(<<<PROMPTSOME_CONTENTPROMPT, liteforge.verboseName("my-forge-instance"))

定义#

verboseName(opts ...aicommon.ConfigOption) LiteForgeExecOption

参数#

参数名参数类型参数解释
opts...aicommon.ConfigOption

返回值#

返回值(顺序)返回值类型返回值解释
r1LiteForgeExecOption