Documentation
¶
Index ¶
- Variables
- func GenerateRequestID() string
- func GenerateSessionID() string
- func GenerateVisionChatImage(file []byte) string
- func PcmToWav(dst []byte) []byte
- type ChatExtra
- type ChatMessage
- type ChatTool
- type ChatToolParameter
- type Config
- type DrawExtendExtra
- type DrawExtendPadPixelConfig
- type DrawExtra
- type DrawPrompt
- type DrawTheme
- type DrawThemePrompts
- type OcrAllData
- type OcrPoint
- type OcrPosData
- type OcrPosDataLocation
- type POI
- type TTSExtra
- type Transcription
- type TranscriptionData
- type VCNData
- type VisionChatMessage
- type Vivo
- func (app *Vivo) AsrLongVoiceRecognition(file string) (string, error)
- func (app *Vivo) AsrShortVoiceRecognition(file string) (string, error)
- func (app *Vivo) Chat(requestID string, sessionID string, messages []ChatMessage, extra *ChatExtra) (ChatMessage, error)
- func (app *Vivo) ChatStream(requestID string, sessionID string, messages []ChatMessage, extra *ChatExtra, ...) error
- func (app *Vivo) ChatWithTools(sessionID string, messages []ChatMessage, extra *ChatExtra, tools []ChatTool) (string, error)
- func (app *Vivo) DialectRecognition(file string) (string, error)
- func (app *Vivo) Draw(prompt string, theme string, extra ...DrawExtra) (string, error)
- func (app *Vivo) Draw2Draw(pic []byte, theme string, extra ...DrawExtra) (string, error)
- func (app *Vivo) DrawCancel(task_id string)
- func (app *Vivo) DrawExtend(pic []byte, theme string, mode int, format string, extra ...DrawExtendExtra) (string, error)
- func (app *Vivo) DrawGetRecommendationPrompts() ([]DrawThemePrompts, error)
- func (app *Vivo) DrawGetResult(task_id string) (string, int, error)
- func (app *Vivo) DrawGetThemes(drawType string) ([]DrawTheme, error)
- func (app *Vivo) EasyChat(sessionID string, message string, systemPrompt ...string) (string, error)
- func (app *Vivo) EasyChatStream(sessionID string, message string, during func(s string), ...) error
- func (app *Vivo) GeoPOISearch(keywords string, city string, page int, page_size ...int) ([]POI, int, error)
- func (app *Vivo) NewTranscription(filePath string) *Transcription
- func (app *Vivo) OCR(pic []byte, mode int) (interface{}, error)
- func (app *Vivo) QueryRewrite(historys []string, query string) (string, error)
- func (app *Vivo) TTS(mode string, vcn string, text string, extra ...TTSExtra) ([]byte, error)
- func (app *Vivo) TextSimilarity(model string, text string, senetences []string) ([]float64, error)
- func (app *Vivo) TextVector(model string, text []string) ([][]float64, error)
- func (app *Vivo) Translate(from string, to string, text string) (string, error)
- func (app *Vivo) VisionChat(requestID string, sessionID string, model string, messages []VisionChatMessage, ...) (VisionChatMessage, error)
- func (app *Vivo) VisionChatStream(requestID string, sessionID string, model string, messages []VisionChatMessage, ...) error
- func (app *Vivo) VoiceClean() error
- func (app *Vivo) VoiceCreate(file string, text string) (string, VoiceCreateResponse, error)
- func (app *Vivo) VoiceDelete(vcn string) error
- func (app *Vivo) VoiceGET(vcn string) (VCNData, error)
- func (app *Vivo) VoiceGetList() ([]VCNData, error)
- type VoiceCreateResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CHAT_ROLE_USER = "user" CHAT_ROLE_ASSISTANT = "assistant" CHAT_ROLE_SYSTEM = "system" CHAT_ROLE_FUNCTION = "function" )
View Source
var ( DRAW_THEME_GENERAL = "4cbc9165bc615ea0815301116e7925a3" // 通用v6.0 DRAW_THEME_ANIME = "85ae2641576f5c409b273e0f490f15c0" // 梦幻动漫 DRAW_THEME_REAL = "85062a504de85d719df43f268199c308" // 唯美写实 DRAW_THEME_RED = "b3aacd62d38c5dbfb3f3491c00ba62f0" // 绯红烈焰 DRAW_THEME_JAPEN = "897c280803be513fa947f914508f3134" // 彩绘日漫 DRAW_TASK_STATUS_QUEUE = 0 // 队列中,等待处理 DRAW_TASK_STATUS_RUNNING = 1 // 正在处理 DRAW_TASK_STATUS_COMPLETE = 2 // 处理完成 DRAW_TASK_STATUS_FAILED = 3 // 处理失败 DRAW_TASK_STATUS_CANCEL = 4 // 已取消 DRAW_TYPE_TXT2IMG = "txt2img" // 文生图 DRAW_TYPE_IMG2IMG = "img2img" // 图生图 DRAW_EXTEND_MODE_MULTIPLE = 1 // 外扩倍数扩充 DRAW_EXTEND_MODE_PROPORTION = 2 // 按比例扩充 DRAW_EXTEND_MODE_PIXEL = 3 // 按像素扩充 DRAW_IMAGE_FORMAT_PNG = "PNG" DRAW_IMAGE_FORMAT_JPEG = "JPEG" )
View Source
var ( OCR_MODE_ONLY = 0 // 仅返回文字信息 OCR_MODE_POS = 1 // 提供文字信息和坐标信息 OCR_MODE_ALL = 2 // ONLY和POS两种模式的信息同时提供 )
View Source
var ( TEXT_SIMILARITY_MODEL_BGE_LARGE = "bge-reranker-large" TEXT_SIMILARITY_MODEL_BGE_V2 = "bge-reranker-v2-m3" )
View Source
var ( TRANSLATE_LANGUAGE_AUTO = "auto" // (我测试的时候似乎不能用,还是手动选择语言吧)自动识别语言 TRANSLATE_LANGUAGE_CHINESE = "zh-CHS" TRANSLATE_LANGUAGE_ENGLISH = "en" TRANSLATE_LANGUAGE_JAPANESE = "ja" TRANSLATE_LANGUAGE_KOREAN = "ko" // 韩语 )
View Source
var ( TTS_MODE_SHORT = "short_audio_synthesis_jovi" TTS_MODE_LONG = "long_audio_synthesis_screen" TTS_MODE_HUMAN = "tts_humanoid_lam" TTS_MODE_REPLICA = "tts_replica" // 音色复刻专用 )
View Source
var ( CHAT_MESSAGE_TEXT = "text" CHAT_MESSAGE_IMAGE = "image" VISION_CHAT_MODEL_BLUELM_PRD = "BlueLM-Vision-prd" VISION_CHAT_MODEL_BLUELM_V2 = "vivo-BlueLM-V-2.0" )
View Source
var (
VECTOR_MODEL_M3E = "m3e-base"
)
Functions ¶
func GenerateRequestID ¶
func GenerateRequestID() string
func GenerateSessionID ¶
func GenerateSessionID() string
func GenerateVisionChatImage ¶ added in v0.3.1
Types ¶
type ChatMessage ¶
type ChatTool ¶ added in v1.1.0
type ChatToolParameter ¶ added in v1.1.0
type DrawExtendExtra ¶
type DrawExtendExtra struct {
Seed int `json:"seed,omitempty"`
PadFactor int `json:"padFactor,omitempty"`
PadRatio string `json:"padRatio,omitempty"`
PadPixel *DrawExtendPadPixelConfig `json:"padPixel,omitempty"`
}
type DrawExtra ¶
type DrawExtra struct {
Height int `json:"height,omitempty"`
Width int `json:"width,omitempty"`
Seed int `json:"seed,omitempty"`
CfgScale float64 `json:"cfgScale,omitempty"`
DenoisingStrength float64 `json:"denoisingStrength,omitempty"`
CtrlNetStrength float64 `json:"ctrlNetStrength,omitempty"`
Steps int `json:"steps,omitempty"`
NegativePrompt string `json:"negativePrompt,omitempty"`
}
type DrawPrompt ¶
type DrawThemePrompts ¶
type DrawThemePrompts struct {
StylePrompts []DrawPrompt `json:"style_prompts"`
StyleID string `json:"style_id"`
}
type OcrAllData ¶ added in v0.2.1
type OcrAllData struct {
Pos []OcrPosData
Word string
}
type OcrPosData ¶ added in v0.2.1
type OcrPosData struct {
Location OcrPosDataLocation `json:"location"`
Words string `json:"words"`
}
type OcrPosDataLocation ¶ added in v0.2.1
type Transcription ¶ added in v0.4.1
type Transcription struct {
// contains filtered or unexported fields
}
func (*Transcription) GetResult ¶ added in v0.4.1
func (t *Transcription) GetResult() ([]TranscriptionData, error)
func (*Transcription) GetTaskInfo ¶ added in v0.4.1
func (t *Transcription) GetTaskInfo() (int, error)
func (*Transcription) Start ¶ added in v0.4.1
func (t *Transcription) Start() error
func (*Transcription) Upload ¶ added in v0.4.1
func (t *Transcription) Upload() error
type TranscriptionData ¶ added in v0.4.1
type VisionChatMessage ¶ added in v0.3.1
type Vivo ¶
type Vivo struct {
// contains filtered or unexported fields
}
func NewVivoAIGC ¶
func (*Vivo) AsrLongVoiceRecognition ¶ added in v0.4.1
func (*Vivo) AsrShortVoiceRecognition ¶ added in v0.4.1
func (*Vivo) Chat ¶
func (app *Vivo) Chat(requestID string, sessionID string, messages []ChatMessage, extra *ChatExtra) (ChatMessage, error)
func (*Vivo) ChatStream ¶ added in v0.2.1
func (*Vivo) ChatWithTools ¶ added in v1.1.0
func (*Vivo) DialectRecognition ¶ added in v1.0.0
func (*Vivo) DrawCancel ¶
func (*Vivo) DrawExtend ¶
func (*Vivo) DrawGetRecommendationPrompts ¶
func (app *Vivo) DrawGetRecommendationPrompts() ([]DrawThemePrompts, error)
DrawGetRecommendationPrompts 获取文生图推荐词列表
func (*Vivo) DrawGetResult ¶
DrawGetResult 如果成功则返回url,其他状态(可能是等待、排队等等)返回string为空,返回的int是状态
func (*Vivo) DrawGetThemes ¶
DrawGetThemes获取绘图全部theme , StyleID对应theme参数,DRAW_THEME_内置了一些theme
func (*Vivo) EasyChatStream ¶ added in v0.2.1
func (*Vivo) GeoPOISearch ¶ added in v0.2.1
func (*Vivo) NewTranscription ¶ added in v0.4.1
func (app *Vivo) NewTranscription(filePath string) *Transcription
func (*Vivo) QueryRewrite ¶ added in v0.3.1
func (*Vivo) TextSimilarity ¶ added in v0.3.1
func (*Vivo) TextVector ¶ added in v0.2.1
func (*Vivo) VisionChat ¶ added in v0.3.1
func (app *Vivo) VisionChat(requestID string, sessionID string, model string, messages []VisionChatMessage, extra *ChatExtra) (VisionChatMessage, error)
func (*Vivo) VisionChatStream ¶ added in v0.3.1
func (*Vivo) VoiceClean ¶ added in v0.3.1
func (*Vivo) VoiceCreate ¶ added in v0.3.1
func (*Vivo) VoiceDelete ¶ added in v0.3.1
func (*Vivo) VoiceGetList ¶ added in v0.3.1
type VoiceCreateResponse ¶ added in v0.3.1
Click to show internal directories.
Click to hide internal directories.