We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i have a function to integrate the history messages. how to do?
func (ai AIOfficialGPT) ParseMessages(q *AIParams) []openai.ChatCompletionMessageParamUnion { // system prompt messages := make([]openai.ChatCompletionMessageParamUnion, 0) if len(q.PromptSystem) > 0 { messages = append(messages, openai.SystemMessage(q.PromptSystem)) } for _, v := range q.History { if len(v.Message) > 0 { if v.Attachment != nil { // gpt if v.Attachment.Type == "image" { messages = append(messages, openai.ChatCompletionMessageParamUnion{ //Role: openai.ChatMessageRoleUser, //MultiContent: []openai.ChatMessagePart{ // { // Type: "image_url", // Text: "", // ImageURL: &openai.ChatMessageImageURL{ // // todo // URL: v.Attachment.FileUrl, // Detail: "auto", // }, // }, // { // Type: "text", // Text: v.Message, // ImageURL: nil, // }, //}, }) } } else { messages = append(messages, openai.UserMessage(v.Message)) } } if len(v.Reply) > 0 { messages = append(messages, openai.UserMessage(v.Reply)) } } return messages }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
i have a function to integrate the history messages.
how to do?
The text was updated successfully, but these errors were encountered: