Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
d81fdb0f9c Update version to v1.4.81 and commit 2024-10-29 22:39:03 +00:00
Eugen Eisler
38406ee586 feat: split tools messages from use message 2024-10-29 23:37:38 +01:00
github-actions[bot]
f2fdd6e6d3 Update version to v1.4.80 and commit 2024-10-29 21:12:27 +00:00
Eugen Eisler
ee3668006d feat: impl. multi-model / attachments, images 2024-10-29 22:12:06 +01:00
4 changed files with 26 additions and 16 deletions

View File

@@ -217,6 +217,7 @@ Application Options:
-v, --variable= Values for pattern variables, e.g. -v=#role:expert -v=#points:30"
-C, --context= Choose a context from the available contexts
--session= Choose a session from the available sessions
-a, --attachment= Attachment path or URL (e.g. for OpenAI image recognition messages)
-S, --setup Run setup for all reconfigurable parts of fabric
-t, --temperature= Set temperature (default: 0.7)
-T, --topp= Set top P (default: 0.9)

View File

@@ -134,6 +134,8 @@ func Cli(version string) (err error) {
// if none of the above currentFlags are set, run the initiate chat function
var messageTools string
if currentFlags.YouTube != "" {
if registry.YouTube.IsConfigured() == false {
err = fmt.Errorf("YouTube is not configured, please run the setup procedure")
@@ -158,8 +160,7 @@ func Cli(version string) (err error) {
if transcript, err = registry.YouTube.GrabTranscript(videoId, language); err != nil {
return
}
currentFlags.AppendMessage(transcript)
messageTools = AppendMessage(messageTools, transcript)
}
if currentFlags.YouTubeComments {
@@ -170,12 +171,12 @@ func Cli(version string) (err error) {
commentsString := strings.Join(comments, "\n")
currentFlags.AppendMessage(commentsString)
messageTools = AppendMessage(messageTools, commentsString)
}
if !currentFlags.IsChatRequest() {
// if the pattern flag is not set, we wanted only to grab the transcript or comments
fmt.Println(currentFlags.Message)
fmt.Println(messageTools)
return
}
}
@@ -187,8 +188,7 @@ func Cli(version string) (err error) {
if website, err = registry.Jina.ScrapeURL(currentFlags.ScrapeURL); err != nil {
return
}
currentFlags.AppendMessage(website)
messageTools = AppendMessage(messageTools, website)
}
// Check if the scrape_question flag is set and call ScrapeQuestion
@@ -198,16 +198,20 @@ func Cli(version string) (err error) {
return
}
currentFlags.AppendMessage(website)
messageTools = AppendMessage(messageTools, website)
}
if !currentFlags.IsChatRequest() {
// if the pattern flag is not set, we wanted only to grab the url or get the answer to the question
fmt.Println(currentFlags.Message)
fmt.Println(messageTools)
return
}
}
if messageTools != "" {
currentFlags.AppendMessage(messageTools)
}
var chatter *core.Chatter
if chatter, err = registry.GetChatter(currentFlags.Model, currentFlags.Stream, currentFlags.DryRun); err != nil {
return

View File

@@ -20,7 +20,7 @@ type Flags struct {
PatternVariables map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=#role:expert -v=#points:30"`
Context string `short:"C" long:"context" description:"Choose a context from the available contexts" default:""`
Session string `long:"session" description:"Choose a session from the available sessions"`
Attachments []string `short:"a" long:"attachment" description:"Attachment path or URL"`
Attachments []string `short:"a" long:"attachment" description:"Attachment path or URL (e.g. for OpenAI image recognition messages)"`
Setup bool `short:"S" long:"setup" description:"Run setup for all reconfigurable parts of fabric"`
Temperature float64 `short:"t" long:"temperature" description:"Set temperature" default:"0.7"`
TopP float64 `short:"T" long:"topp" description:"Set top P" default:"0.9"`
@@ -182,15 +182,20 @@ func (o *Flags) BuildChatRequest(Meta string) (ret *common.ChatRequest, err erro
}
func (o *Flags) AppendMessage(message string) {
if o.Message != "" {
o.Message = o.Message + "\n" + message
} else {
o.Message = message
}
o.Message = AppendMessage(o.Message, message)
return
}
func (o *Flags) IsChatRequest() (ret bool) {
ret = o.Message != "" || o.Context != "" || o.Session != "" || o.Pattern != "" || len(o.Attachments) > 0
ret = o.Message != "" || len(o.Attachments) > 0 || o.Context != "" || o.Session != "" || o.Pattern != ""
return
}
func AppendMessage(message string, newMessage string) (ret string) {
if message != "" {
ret = message + "\n" + newMessage
} else {
ret = newMessage
}
return
}

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.79"
var version = "v1.4.81"