From 21f3b4cf981ac618c1ad2680f28657ab55478cbf Mon Sep 17 00:00:00 2001 From: bovem Date: Tue, 16 Jan 2024 23:51:09 +0530 Subject: [PATCH 1/8] Added prompt for creating a bragging document --- utils/bragDocument.go | 84 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 utils/bragDocument.go diff --git a/utils/bragDocument.go b/utils/bragDocument.go new file mode 100644 index 0000000..23c9861 --- /dev/null +++ b/utils/bragDocument.go @@ -0,0 +1,84 @@ +package utils + +var BragDocTemplate = `Draft a bragging document from my perspective +using the journal data provided below. + +The document should be written in a formal tone as it has to be shared +with my manager and stakeholders and it impacts my personal growth. +Omit the fields you think don't have enough information in journals. + +The document should be in the following format: +# Work Accomplishments +Insert the list of personal work done in great details, mentioning important +hyperlinks like jira tickets, pull request links, and other relevant document links +. It should be grouped by projects like following + +## AIS Maritime Traffic Dashboard +### Completed +* Created a scraper to fetch the data for current maritime traffic. +* Integrated PostgresDB to store the daily data for maritime traffic. +* Created an GraphQL API to access the data from different services. + +### In progress +* Working on a Grafana Dashboard to visualize the maritime traffic. + +### Todos +* Exploring methodologies to improve scraping performance. + +## Work Project 2 +### Completed +* Completed tasks + +### In progress +* In Progress tasks + +### Todos +* Task not started yet but planning to be + +Emphasize on the following points +* If I designed or built something from scratch +* Useful insights during the design or coding process +* Impact of individual projects +* Using numbers to show impact like reduced response time by X%, decreased cloud costs by X%\ + +# Collaboration and Mentorship +Write about collaboration and mentorship work done by me in bullet points like following: + +* Helped intern with a task he was stuck on +* Worked with multiple teams to resolve a crucial production bug. + +Empasize on the following points +* Write about each point in great detail supporting it with hyperlinks when necessary +* Write about conclusion from each point. As in the final impract of helping the intern +* Points about helping other with the skills that I am good at +* Improving monitoring and logging +* Code reviews and merge request collaborations +* Important questions and meeting attended +* Giving talks or conducting workshops and hackathons internally + +# Design and Documentation +Write about design and documentation efforts done by in the following format + +## Project 1 +* Designed API services for Project 1 + +## Project 2 +* Improved documentation for Project 2 by adding information for new features. +* Added a FAQ section for Project 2 with the questions frequently asked by our partners and customers. + +# Company Building +Write in bullet points about the interviewing and recruiting process contributions from my side. +Also write about contributions to new hire guide, onbording documents, and Knowledge Transfer sessions +with the new hires. + +# Learning +Write about tools and technologies learned throughout the time period and how it could be useful in our +current workflows. + +# Outside of Work +Write about blog posts, videos or any other content creation outside the work that is somehow related to +the work. Also write about +* Talks and event participation +* Contributing to OpenSource projects +* Reognitions from any other part of industry. Like awards +` From 9f32f79d929a9b79c7d2e2ad3eb1b5936457416a Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 00:01:51 +0530 Subject: [PATCH 2/8] Fixed grammatical mistakes --- utils/bragDocument.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/utils/bragDocument.go b/utils/bragDocument.go index 23c9861..d992d53 100644 --- a/utils/bragDocument.go +++ b/utils/bragDocument.go @@ -9,15 +9,15 @@ Omit the fields you think don't have enough information in journals. The document should be in the following format: # Work Accomplishments -Insert the list of personal work done in great details, mentioning important -hyperlinks like jira tickets, pull request links, and other relevant document links -. It should be grouped by projects like following +Insert the list of personal work done in great detail, mentioning important +hyperlinks like Jira tickets, pull request links, and other relevant document links +. It should be grouped by projects like the following ## AIS Maritime Traffic Dashboard ### Completed * Created a scraper to fetch the data for current maritime traffic. * Integrated PostgresDB to store the daily data for maritime traffic. -* Created an GraphQL API to access the data from different services. +* Created a GraphQL API to access the data from different services. ### In progress * Working on a Grafana Dashboard to visualize the maritime traffic. @@ -35,29 +35,29 @@ hyperlinks like jira tickets, pull request links, and other relevant document li ### Todos * Task not started yet but planning to be -Emphasize on the following points +Emphasize the following points * If I designed or built something from scratch * Useful insights during the design or coding process * Impact of individual projects * Using numbers to show impact like reduced response time by X%, decreased cloud costs by X%\ # Collaboration and Mentorship -Write about collaboration and mentorship work done by me in bullet points like following: +Write about collaboration and mentorship work done by me in bullet points like the following: * Helped intern with a task he was stuck on * Worked with multiple teams to resolve a crucial production bug. -Empasize on the following points +Emphasize the following points * Write about each point in great detail supporting it with hyperlinks when necessary -* Write about conclusion from each point. As in the final impract of helping the intern -* Points about helping other with the skills that I am good at +* Write about the conclusion from each point. As in the final impact of helping the intern +* Points about helping others with the skills that I know. * Improving monitoring and logging * Code reviews and merge request collaborations -* Important questions and meeting attended +* Important questions and meetings attended * Giving talks or conducting workshops and hackathons internally # Design and Documentation -Write about design and documentation efforts done by in the following format +Write about design and documentation efforts done in the following format ## Project 1 * Designed API services for Project 1 @@ -68,17 +68,17 @@ Write about design and documentation efforts done by in the following format # Company Building Write in bullet points about the interviewing and recruiting process contributions from my side. -Also write about contributions to new hire guide, onbording documents, and Knowledge Transfer sessions +Also write about contributions to the new hire guide, onboarding documents, and Knowledge Transfer sessions with the new hires. # Learning -Write about tools and technologies learned throughout the time period and how it could be useful in our +Write about tools and technologies learned throughout the period and how they could be useful in our current workflows. # Outside of Work -Write about blog posts, videos or any other content creation outside the work that is somehow related to -the work. Also write about +Write about blog posts, videos, or any other content creation outside the work that is somehow related to +the work. Also, write about * Talks and event participation * Contributing to OpenSource projects -* Reognitions from any other part of industry. Like awards +* Recognition from any other part of the industry. Like awards. ` From 66b1d6a64c44d0c4f02a404980fe74f45c34ac9a Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 00:55:15 +0530 Subject: [PATCH 3/8] Updated README --- README.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 01724dc..61dbb10 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ curl -L https://github.com/bovem/brag/releases/download/v0.1/brag-linux-amd64 > ``` ## Setup and Usage + +### Initialize To initialize a bragging document directory create a Git repository on any provider like GitHub, GitLab, BitBucket, etc., and clone the repository locally. You can also create a local Git repository using `git init`. @@ -36,6 +38,7 @@ using the `init` subcommand. brag init ``` +### Adding a new brag You can add your brags using the `-c`/`--comment` flag. ```bash brag -c "YOUR TEXT HERE" @@ -44,6 +47,7 @@ brag -c "YOUR TEXT HERE" The brags will be added to the directory specified in the `BRAG_DOCS_LOC` environment variable. +### Review your brags To review brags added in a given time period use subcommand `about`. ```bash brag about last-week @@ -52,11 +56,7 @@ brag about last-week If the `BRAG_DOCS_REPO_SYNC` environment variable is set to `true` then new brags will be committed and pushed to the Git remote. -## Todos -- [ ] Add a `edit` subcommand to edit recent entries -- [ ] Add a `summarize` subcommand to create a formatted bragging document using LLMs hosted on Ollama - -## Sample Output +#### Sample Output ```text 2024-01-02 * 11:12:50 Updated Quarterly Status Report @@ -68,3 +68,85 @@ will be committed and pushed to the Git remote. 2024-01-04 * 17:39:50 Provisioned a new Kubernetes cluster ``` + +### Summarize your brags using self hosted LLMs +To summarize the accomplishments and build a draft for bragging document use the command +`summarize` with a timeframe (similar to `about` command). +```bash +brag summarize last-month +``` +If [Ollama](https://www.avni.sh/posts/homelab/self-hosting-ollama/) is deployed and the +`OLLAMA_URL` environment variables is pointing to your Ollama deployment then +a draft bragging document will be generated on your terminal. + +Before generating the document the summarize command will ask for the names of your personal +and work project, name of your blog and other content creation channels to differentiate +your work and personal updates in the summarized document. + +#### Sample Output +```text +Enter the name of your work projects: +Enter the name of your personal projects: +Enter the name of your blog, youtube or any other content creation channels: +Draft Bragging Document + +Introduction: + +I am excited to share my accomplishments and growth over the past year with you, our esteemed manager and stakeholders. As an integral member of our team, I have been actively contributing to various projects, collaborating with colleagues, and learning new tools and technologies. This document highlights my work achievements, collaboration and mentorship efforts, design and documentation, company building, learning, and outside work contributions. + +Work Accomplishments: + +1. Project XYZ: As a member of the development team, I designed and built a comprehensive dashboard for monitoring client satisfaction. The dashboard has been instrumental in providing real-time insights into client feedback, enabling us to address their concerns promptly. (hyperlink to Jira ticket) +2. Project ABC: I collaborated with the UX/UI team to redesign a critical feature of the application. My contributions included designing new layouts and providing constructive feedback during the user testing phase, resulting in an improved user experience. (hyperlink to design document) +3. Project DEF: I contributed to the development of a mobile application for a client's business needs. My responsibilities included writing clean, efficient, and well-documented code, ensuring seamless functionality across various platforms. (hyperlink to pull request) + +Collaboration and Mentorship: + +1. Mentored an intern on the basics of web development, providing guidance on project management, coding best practices, and problem-solving techniques. The intern demonstrated significant improvement throughout the collaboration, showcasing their newfound skills. (hyperlink to mentorship session) +2. Collaborated with cross-functional teams to develop innovative solutions for a client's complex business problem. Through active listening and ideation, we generated several potential ideas and approaches, which were well received by the team and stakeholders. (hyperlink to brainstorming session) +3. Contributed to the creation of an internal knowledge transfer program, providing structured training sessions for new hires. This initiative enhanced the onboarding process, ensuring a smooth transition into our team's workflow. (hyperlink to knowledge transfer session) + +Design and Documentation: + +1. Created comprehensive design documents for each project, including wireframes, mockups, and style guides. These resources were instrumental in communicating design intent to the development team and stakeholders. (hyperlink to design document) +2. Developed a standard operating procedure (SOP) for our team's documentation process, streamlining the creation and maintenance of technical documents. This initiative has resulted in increased efficiency and consistency across our projects. (hyperlink to SOP document) + +Company Building: + +1. Participated in the interviewing and recruiting process, contributing to the identification and hiring of top talent for our team. (hyperlink to job postings) +2. Created an updated new hire guide, providing comprehensive information on our team's workflow, tools, and best practices. This document has been instrumental in ensuring a smooth transition for new team members. (hyperlink to new hire guide) +3. Contributed to the development of internal training programs, enhancing the skills of our team members and fostering a collaborative learning environment. (hyperlink to training program) + +Learning: + +1. Expanded my knowledge of emerging technologies such as React Native, GraphQL, and Machine Learning. Through hands-on projects and collaboration with colleagues, I have gained a deeper understanding of these tools and their potential applications in our workflows. (hyperlink to personal project) +2. Participated in industry events, conferences, and meetups, showcasing our team's work and engaging with peers. These experiences have provided valuable insights into the latest trends and innovations in our field. (hyperlink to event report) + +Outside of Work: + +1. Published articles on Hacker Noon and other industry platforms, sharing my experiences and insights on web development best practices. The articles have received positive feedback from peers and industry leaders, with several shares and likes on social media platforms. (hyperlink to article) +2. Contributed to OpenSource projects, such as [insert project name], providing new features and enhancements that benefit the broader development community. (hyperlink to OpenSource project) +3. Received recognition from industry leaders and peers for my work in web development, including a mention in [insert publication name] and an award at [insert event name]. (hyperlink to publication or event) + +Personal Projects: + +1. Developed a personal website showcasing my work and projects, serving as a portfolio and networking tool. (hyperlink to personal website) +2. Created a blog focusing on web development best practices and emerging technologies, providing valuable insights and resources for the industry. (hyperlink to blog) +3. Fostered a community of developers through social media platforms, sharing knowledge and collaborating on projects. (hyperlink to social media channel) + +Conclusion: +In conclusion, I have demonstrated significant growth and achievements in my role as a web developer within the past year. Through active collaboration, mentorship, design and documentation, company building, learning, and outside work contributions, I have enhanced our team's workflows, fostered a culture of innovation and excellence, and expanded my skill set. I look forward to continuing to contribute to our team's success in the future. + +Additional Information: +Personal Projects: + +* Website: [insert website link] +* Blog: [insert blog link] +* Social Media Channel: [insert social media channel link] + +Note: The above document is a draft and may require revisions based on your feedback. Please feel free to provide your inputs and suggestions, and I will be more than happy to incorporate them into the final document. +``` + +## Todos +- [ ] Add a `edit` subcommand to edit recent entries +- [x] Add a `summarize` subcommand to create a formatted bragging document using LLMs hosted on Ollama From 569fdacd434045f7e2c782d13f9cb2b74902b482 Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 00:58:21 +0530 Subject: [PATCH 4/8] Added information for summarize command flags in readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 61dbb10..3c689cf 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,11 @@ Before generating the document the summarize command will ask for the names of y and work project, name of your blog and other content creation channels to differentiate your work and personal updates in the summarized document. +By default it will use the prompt in [bragDocument.go](./utils/bragDocument.go) but you can +pass your own prompt using the `--prompt` flag. + +To select a different model than `llama2:latest` use flag `--model`. + #### Sample Output ```text Enter the name of your work projects: From b12a375d8e738523d01c3097943d901d44a1eb48 Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 01:05:29 +0530 Subject: [PATCH 5/8] Refactored about command to pull the data --- cmd/about.go | 4 +++- utils/bragAbout.go | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cmd/about.go b/cmd/about.go index e98ad8b..629b7a1 100644 --- a/cmd/about.go +++ b/cmd/about.go @@ -4,6 +4,7 @@ import ( "github.com/bovem/brag/utils" "github.com/spf13/cobra" "strings" + "fmt" ) var timeFrame string @@ -21,7 +22,8 @@ The time period has to be specified in any of the following formats * today/yesterday/last-week/last-month (brag about last-week/brag about yesterday) `, Run: func(cmd *cobra.Command, args []string) { - utils.Bragging(strings.Join(args, " ")) + brags := utils.Bragging(strings.Join(args, " ")) + fmt.Println(brags) }, } diff --git a/utils/bragAbout.go b/utils/bragAbout.go index 0430aa2..7ab5121 100644 --- a/utils/bragAbout.go +++ b/utils/bragAbout.go @@ -10,7 +10,7 @@ import ( "io/ioutil" ) -func Bragging(timeFrame string)(){ +func Bragging(timeFrame string)(string){ bragDocDirLocation := os.Getenv("BRAG_DOCS_LOC") currentTime := time.Now() currentYear := strconv.Itoa(currentTime.Year()) @@ -56,10 +56,12 @@ func Bragging(timeFrame string)(){ } startBraggingFrom := currentTime.AddDate(-numYear, -numMonth, -numDay) - LoopOverFileRange(currentYearDir, startBraggingFrom, endBraggingAt) + fileContents := LoopOverFileRange(currentYearDir, startBraggingFrom, endBraggingAt) + return fileContents } -func LoopOverFileRange(fileDirectory string, startTime time.Time, endTime time.Time)(){ +func LoopOverFileRange(fileDirectory string, startTime time.Time, endTime time.Time)(string){ + var fileContents string tomorrow := endTime.AddDate(0, 0, 1) curDoc:=startTime @@ -75,15 +77,17 @@ func LoopOverFileRange(fileDirectory string, startTime time.Time, endTime time.T documentContent, err := ioutil.ReadFile(currentDocName) if err!=nil { fmt.Printf("Failed to open file: %s\n", currentDocName) - return + continue } //documentContentStr := strings.Replace(string(documentContent), // "# Bragging Items", "", -1) //documentContentStr = strings.Replace(documentContentStr, // "\n", "", 1) - fmt.Println(currentDateStr) - fmt.Printf("%s\n", string(documentContent)) + fileContents += fmt.Sprintf("%s\n", currentDateStr) + fileContents += fmt.Sprintf("%s\n", string(documentContent)) } curDoc = curDoc.AddDate(0, 0, 1) } + + return fileContents } From 716b583d9e11f55a5749ee830c9f67703f80b754 Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 01:05:49 +0530 Subject: [PATCH 6/8] Added subcommand summarize to generate a draft bragging documents usind large language models --- cmd/summarize.go | 38 ++++++++++++++++++++ utils/bragDocument.go | 47 ++++++------------------- utils/bragSummarize.go | 78 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 37 deletions(-) create mode 100644 cmd/summarize.go create mode 100644 utils/bragSummarize.go diff --git a/cmd/summarize.go b/cmd/summarize.go new file mode 100644 index 0000000..e766284 --- /dev/null +++ b/cmd/summarize.go @@ -0,0 +1,38 @@ +package cmd + +import ( + "github.com/bovem/brag/utils" + "github.com/spf13/cobra" + "strings" +) + +var model string +var prompt string + +var summarizeCmd = &cobra.Command{ + Use: "summarize", + Short: "Summarizes the brags from the specified time period in a draft bragging document.", + Long: `Summarizes brags from the specified time period using Large Language Models hosted on Ollama (https://ollama.ai/) +and generates a draft bragging document. + +Requires following environment variable (assuming Ollama is already deployed and the model is downloaded). +$ export OLLAMA_URL="http://localhost:11434" + +For Example: +brag summarize --model llama2:latest last-month +brag summarize --model llama2:latest 2-weeks + +The time period has to be specified in any of the following formats +* - (brag about 2-months/brag about 3-years) +* today/yesterday/last-week/last-month (brag about last-week/brag about yesterday) +`, + Run: func(cmd *cobra.Command, args []string) { + utils.Summarize(strings.Join(args, " "), model, prompt) + }, +} + +func init() { + rootCmd.AddCommand(summarizeCmd) + summarizeCmd.PersistentFlags().StringVarP(&model, "model", "m", "llama2:latest", "LLM Model to be used while generating the bragging document") + summarizeCmd.PersistentFlags().StringVarP(&prompt, "prompt", "p", utils.BragDocTemplate, "LLM Prompt for generating the bragging document") +} diff --git a/utils/bragDocument.go b/utils/bragDocument.go index d992d53..eadd335 100644 --- a/utils/bragDocument.go +++ b/utils/bragDocument.go @@ -7,45 +7,23 @@ The document should be written in a formal tone as it has to be shared with my manager and stakeholders and it impacts my personal growth. Omit the fields you think don't have enough information in journals. -The document should be in the following format: +The document should be in the following format, the project names and content +mentioned in following format is just an example don't use it in the final output +Use the pointers provided in the format below and omit them in the final output: + # Work Accomplishments Insert the list of personal work done in great detail, mentioning important hyperlinks like Jira tickets, pull request links, and other relevant document links -. It should be grouped by projects like the following - -## AIS Maritime Traffic Dashboard -### Completed -* Created a scraper to fetch the data for current maritime traffic. -* Integrated PostgresDB to store the daily data for maritime traffic. -* Created a GraphQL API to access the data from different services. - -### In progress -* Working on a Grafana Dashboard to visualize the maritime traffic. - -### Todos -* Exploring methodologies to improve scraping performance. - -## Work Project 2 -### Completed -* Completed tasks - -### In progress -* In Progress tasks - -### Todos -* Task not started yet but planning to be +. It should be grouped by projects. Emphasize the following points * If I designed or built something from scratch * Useful insights during the design or coding process * Impact of individual projects -* Using numbers to show impact like reduced response time by X%, decreased cloud costs by X%\ +* Using numbers to show impact like reduced response time by X%, decreased cloud costs by X%. # Collaboration and Mentorship -Write about collaboration and mentorship work done by me in bullet points like the following: - -* Helped intern with a task he was stuck on -* Worked with multiple teams to resolve a crucial production bug. +Write about collaboration and mentorship work done by me in bullet points. Emphasize the following points * Write about each point in great detail supporting it with hyperlinks when necessary @@ -57,14 +35,7 @@ Emphasize the following points * Giving talks or conducting workshops and hackathons internally # Design and Documentation -Write about design and documentation efforts done in the following format - -## Project 1 -* Designed API services for Project 1 - -## Project 2 -* Improved documentation for Project 2 by adding information for new features. -* Added a FAQ section for Project 2 with the questions frequently asked by our partners and customers. +Write about design and documentation efforts. # Company Building Write in bullet points about the interviewing and recruiting process contributions from my side. @@ -81,4 +52,6 @@ the work. Also, write about * Talks and event participation * Contributing to OpenSource projects * Recognition from any other part of the industry. Like awards. + +Additional information about personal projects and blogs will be mentioned after the journal. ` diff --git a/utils/bragSummarize.go b/utils/bragSummarize.go new file mode 100644 index 0000000..eb8946e --- /dev/null +++ b/utils/bragSummarize.go @@ -0,0 +1,78 @@ +package utils + +import ( + "fmt" + "net/http" + "io/ioutil" + "bytes" + "encoding/json" +) + +type ModelResponse struct { + Response string `json:"response"` +} + +func Summarize(timeFrame string, model string, prompt string) () { + ollamaUrl := os.Getenv("OLLAMA_URL") + url := fmt.Sprintf("%s/api/generate", ollamaUrl) + + bragJournal := Bragging(timeFrame) + prompt += fmt.Sprintf("\nJournal:\ns", bragJournal) + + var workProjects string + var personalProjects string + var blogsAndVideos string + + fmt.Print("Enter the name of your work projects:") + fmt.Scanf("s", workProjects) + prompt += "\nNames of Work Projects: " + workProjects + + fmt.Print("Enter the name of your personal projects:") + fmt.Scanf("s", personalProjects) + prompt += "\nNames of Personal Projects: " + personalProjects + + fmt.Print("Enter the name of your blog, youtube or any other content creation channels:") + fmt.Scanf("s", blogsAndVideos) + prompt += "\nNames of blog, youtube channels or any other content creation channels: " + blogsAndVideos + + client := &http.Client{} + body, err := json.Marshal(map[string]interface{}{ + "model": model, + "prompt": prompt, + "stream": false, + }) + if err != nil { + fmt.Println("Error marshaling JSON body") + return + } + + req, err := http.NewRequest("POST", url, bytes.NewReader(body)) + if err != nil { + fmt.Println("Error creating new HTTP request") + return + } + + req.Header.Set("Content-Type", "application/json") + + resp, err := client.Do(req) + if err != nil { + fmt.Println("Error making POST request to URL", url) + return + } + + // Read the response body + body, err = ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Println("Error reading response body") + return + } + + var modelResponse ModelResponse + err = json.Unmarshal(body, &modelResponse) + if err != nil { + fmt.Println("Error unmarshaling JSON response body") + return + } + + fmt.Println(modelResponse.Response) +} From cc58f2ee9ec704df63656cdb07338d5aec7afe5f Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 01:09:44 +0530 Subject: [PATCH 7/8] Removed redundant comment --- utils/bragSummarize.go | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/bragSummarize.go b/utils/bragSummarize.go index eb8946e..6586104 100644 --- a/utils/bragSummarize.go +++ b/utils/bragSummarize.go @@ -60,7 +60,6 @@ func Summarize(timeFrame string, model string, prompt string) () { return } - // Read the response body body, err = ioutil.ReadAll(resp.Body) if err != nil { fmt.Println("Error reading response body") From 5ec9cde68cadd4fa6ba78a9522dcf99b5b6fd509 Mon Sep 17 00:00:00 2001 From: bovem Date: Wed, 17 Jan 2024 01:14:36 +0530 Subject: [PATCH 8/8] Fixed the model prompt to omit additional information --- utils/bragDocument.go | 3 ++- utils/bragSummarize.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/bragDocument.go b/utils/bragDocument.go index eadd335..4d8f63d 100644 --- a/utils/bragDocument.go +++ b/utils/bragDocument.go @@ -1,7 +1,7 @@ package utils var BragDocTemplate = `Draft a bragging document from my perspective -using the journal data provided below. +using only the journal data provided below. The document should be written in a formal tone as it has to be shared with my manager and stakeholders and it impacts my personal growth. @@ -54,4 +54,5 @@ the work. Also, write about * Recognition from any other part of the industry. Like awards. Additional information about personal projects and blogs will be mentioned after the journal. +Do not add additional information which is not present in the journal. ` diff --git a/utils/bragSummarize.go b/utils/bragSummarize.go index 6586104..fc37b8e 100644 --- a/utils/bragSummarize.go +++ b/utils/bragSummarize.go @@ -6,6 +6,7 @@ import ( "io/ioutil" "bytes" "encoding/json" + "os" ) type ModelResponse struct {