Compare commits

...

11 Commits

Author SHA1 Message Date
github-actions[bot]
d1c527c421 Update version to v1.4.57 and commit 2024-10-11 19:27:41 +00:00
Eugen Eisler
c0bd61ba49 docs: Close #1035, provide better example for pattern variables 2024-10-11 22:27:20 +03:00
github-actions[bot]
8f0cc85742 Update version to v1.4.56 and commit 2024-10-11 18:54:25 +00:00
Eugen Eisler
7275dfbd6b Merge pull request #1039 from hallelujah-shih/feature/set-default-lang
Feature/set default lang
2024-10-11 20:54:10 +02:00
hallelujah-shih
9f94cfb718 fmt 2024-10-10 19:45:39 +08:00
hallelujah-shih
e1fa674a3f support set default output language
# Conflicts:
#	cli/cli.go
#	core/fabric.go
2024-10-10 19:37:51 +08:00
github-actions[bot]
34f804be3a Update version to v1.4.55 and commit 2024-10-09 09:29:17 +00:00
Eugen Eisler
83cd8a1912 fix: Close #1036 2024-10-09 12:29:02 +03:00
github-actions[bot]
d347ef0dcc Update version to v1.4.54 and commit 2024-10-07 16:44:19 +00:00
Eugen Eisler
44cc9bbcac Merge pull request #1021 from joshuafuller/main
Corrected spelling and grammatical errors for consistency and clarity for transcribe_minutes
2024-10-07 18:44:06 +02:00
Joshua Fuller
bad01040e3 Corrected spelling and grammatical errors for consistency and clarity
Description:

Changed "agreed within the meeting" to "agreed upon within the meeting" to improve grammatical accuracy.

Added missing periods to ensure consistency across list items.

Corrected the spelling of "highliting" to "highlighting."

Fixed the spelling of "exxactly" to "exactly."

Updated phrasing in "Write NEXT STEPS a 2-3 sentences" to "Write NEXT STEPS as 2-3 sentences" for grammatical correctness.

These changes improve the readability and consistency of the document, ensuring all instructions are clear and error-free.
2024-10-05 17:29:12 -05:00
7 changed files with 74 additions and 15 deletions

View File

@@ -213,7 +213,7 @@ Usage:
Application Options:
-p, --pattern= Choose a pattern from the available patterns
-v, --variable= Values for pattern variables, e.g. -v=$name:John -v=$age:30
-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
-S, --setup Run setup for all reconfigurable parts of fabric
@@ -293,7 +293,7 @@ pbpaste | fabric --stream --pattern analyze_claims
3. Run the `extract_wisdom` Pattern with the `--stream` option to get immediate and streaming results from any Youtube video (much like in the original introduction video).
```bash
fabric -y "https://youtube.com/watch?v=uXs-zPc63kM" | --stream --pattern extract_wisdom
fabric -y "https://youtube.com/watch?v=uXs-zPc63kM" --stream --pattern extract_wisdom
```
4. Create patterns- you must create a .md file with the pattern and save it to ~/.config/fabric/patterns/[yourpatternname].

View File

@@ -146,8 +146,12 @@ func Cli(version string) (err error) {
if !currentFlags.YouTubeComments || currentFlags.YouTubeTranscript {
var transcript string
var language = "en"
if currentFlags.Language != "" {
language = currentFlags.Language
if currentFlags.Language != "" || fabric.DefaultLanguage.Value != "" {
if currentFlags.Language != "" {
language = currentFlags.Language
} else {
language = fabric.DefaultLanguage.Value
}
}
if transcript, err = fabric.YouTube.GrabTranscript(videoId, language); err != nil {
return
@@ -208,7 +212,11 @@ func Cli(version string) (err error) {
}
var session *db.Session
if session, err = chatter.Send(currentFlags.BuildChatRequest(strings.Join(os.Args[1:], " ")), currentFlags.BuildChatOptions()); err != nil {
chatReq := currentFlags.BuildChatRequest(strings.Join(os.Args[1:], " "))
if chatReq.Language == "" {
chatReq.Language = fabric.DefaultLanguage.Value
}
if session, err = chatter.Send(chatReq, currentFlags.BuildChatOptions()); err != nil {
return
}

View File

@@ -15,7 +15,7 @@ import (
// Flags create flags struct. the users flags go into this, this will be passed to the chat struct in cli
type Flags struct {
Pattern string `short:"p" long:"pattern" description:"Choose a pattern from the available patterns" default:""`
PatternVariables map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=$name:John -v=$age:30"`
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"`
Setup bool `short:"S" long:"setup" description:"Run setup for all reconfigurable parts of fabric"`

View File

@@ -3,10 +3,14 @@ package core
import (
"bytes"
"fmt"
"os"
"strconv"
"github.com/atotto/clipboard"
"github.com/danielmiessler/fabric/common"
"github.com/danielmiessler/fabric/db"
"github.com/danielmiessler/fabric/jina"
"github.com/danielmiessler/fabric/lang"
"github.com/danielmiessler/fabric/vendors/anthropic"
"github.com/danielmiessler/fabric/vendors/azure"
"github.com/danielmiessler/fabric/vendors/dryrun"
@@ -19,8 +23,6 @@ import (
"github.com/danielmiessler/fabric/vendors/siliconcloud"
"github.com/danielmiessler/fabric/youtube"
"github.com/pkg/errors"
"os"
"strconv"
)
const DefaultPatternsGitRepoUrl = "https://github.com/danielmiessler/fabric.git"
@@ -49,6 +51,7 @@ func NewFabricBase(db *db.Db) (ret *Fabric) {
VendorsAll: NewVendorsManager(),
PatternsLoader: NewPatternsLoader(db.Patterns),
YouTube: youtube.NewYouTube(),
Language: lang.NewLanguage(),
Jina: jina.NewClient(),
}
@@ -75,6 +78,7 @@ type Fabric struct {
VendorsAll *VendorsManager
*PatternsLoader
*youtube.YouTube
*lang.Language
Jina *jina.Client
Db *db.Db
@@ -101,6 +105,7 @@ func (o *Fabric) SaveEnvFile() (err error) {
o.YouTube.SetupFillEnvFileContent(&envFileContent)
o.Jina.SetupFillEnvFileContent(&envFileContent)
o.Language.SetupFillEnvFileContent(&envFileContent)
err = o.Db.SaveEnv(envFileContent.String())
return
@@ -125,6 +130,10 @@ func (o *Fabric) Setup() (err error) {
return
}
if err = o.Language.SetupOrSkip(); err != nil {
return
}
err = o.SaveEnvFile()
return
@@ -200,6 +209,7 @@ func (o *Fabric) configure() (err error) {
//YouTube and Jina are not mandatory, so ignore not configured error
_ = o.YouTube.Configure()
_ = o.Jina.Configure()
_ = o.Language.Configure()
return
}

41
lang/language.go Normal file
View File

@@ -0,0 +1,41 @@
package lang
import (
"github.com/danielmiessler/fabric/common"
"golang.org/x/text/language"
)
func NewLanguage() (ret *Language) {
label := "Language"
ret = &Language{}
ret.Configurable = &common.Configurable{
Label: label,
EnvNamePrefix: common.BuildEnvVariablePrefix(label),
ConfigureCustom: ret.configure,
}
ret.DefaultLanguage = ret.Configurable.AddSetupQuestionCustom("Output", false,
"Enter your default want output lang (for example: zh_CN)")
return
}
type Language struct {
*common.Configurable
DefaultLanguage *common.SetupQuestion
}
func (o *Language) configure() error {
if o.DefaultLanguage.Value != "" {
langTag, err := language.Parse(o.DefaultLanguage.Value)
if err == nil {
o.DefaultLanguage.Value = langTag.String()
} else {
o.DefaultLanguage.Value = ""
}
}
return nil
}

View File

@@ -8,15 +8,15 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Fully digest the content provided.
- Extract all actionables agreed within the meeting.
- Extract all actionables agreed upon within the meeting.
- Extract any interesting ideas brought up in the meeting.
- In a section called TITLE, write a 1 to 5 word title for the meeting
- In a section called TITLE, write a 1 to 5 word title for the meeting.
- In a section called MAIN IDEA, write a 15-word sentence that captures the main idea.
- In a section called MINUTES, write 20 to 50 bullet points, highliting of the most surprising, insightful, and/or interesting ideas that come up in the conversation. If there are less than 50 then collect all of them. Make sure you extract at least 20.
- In a section called MINUTES, write 20 to 50 bullet points, highlighting of the most surprising, insightful, and/or interesting ideas that come up in the conversation. If there are less than 50 then collect all of them. Make sure you extract at least 20.
- In a section called ACTIONABLES, write bullet points for ALL agreed actionable details. This includes cases where a speaker agrees to do or look into something. If there is a deadline mentioned, include it here.
@@ -24,16 +24,16 @@ Take a step back and think step-by-step about how to achieve the best possible r
- In a section called CHALLENGES, identify and document any challenges or issues discussed during the meeting. Note any potential solutions or strategies proposed to address these challenges.
- In a section caled NEXT STEPS, outline the next steps and actions to be taken after the meeting
- In a section called NEXT STEPS, outline the next steps and actions to be taken after the meeting.
# OUTPUT INSTRUCTIONS
- Only output Markdown.
- Write MINUTES as exxactly 15 words.
- Write MINUTES as exactly 15 words.
- Write ACTIONABLES as exactly 15 words.
- Write DECISIONS as exactly 15 words.
- Write CHALLENGES as 2-3 sentences.
- Write NEXT STEPS a 2-3 sentences.
- Write NEXT STEPS as 2-3 sentences.
- Do not give warnings or notes; only output the requested sections.
- Do not repeat ideas, quotes, facts, or resources.
- You use bulleted lists for output, not numbered lists.

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.53"
var version = "v1.4.57"