Documentation
¶
Index ¶
- Constants
- Variables
- func ChannelLink(link string) (string, error)
- func ClampString(input string, clamp int) string
- func CleanCode(input string) string
- func ContextualizeLink(url string) (string, error)
- func ConvertNumToPriority(input int64) string
- func CreateNote(note Note) (string, error)
- func CreateTask(task Task) (string, error)
- func ExtractLinksAndReplaceDomains(input string) (urls []string, message string)
- func ExtractLocationFromSMS(message string) (string, error)
- func ExtractNoteTypes(data map[string]interface{}) []string
- func ExtractSystemContent(message string) (string, error)
- func ExtractTimezone(dateStr string) (string, error)
- func ExtractYoutubeID(video string) (string, error)
- func FetchNoteTypes() ([]string, error)
- func FetchPageContent(url string) (string, error)
- func FetchYoutubeData(video string) (string, error)
- func GetType(message string) (string, error)
- func IndexOf(slice []string, item string) int
- func Ingest(message string, instructions ...string) (string, error)
- func IngestNote(note string, instructions ...string) (string, error)
- func IngestTask(task string, instructions ...string) (string, error)
- func IsNumber(s string) bool
- func Message(phone string, message string) error
- func Process(message string, instructions ...string) (string, error)
- func Prompt(user string, system string, model ...string) (string, error)
- func RemoveEmptyLines(lines []string) []string
- func RemoveEmptyStrings(slice []string) []string
- func RemoveIndex(slice []string, s int) []string
- func RemoveInstruction(message string) string
- func RemoveLeadingWhitespace(input string) string
- func RemoveNewline(input string) string
- func SetTimezoneFromLocation(location string) (string, error)
- func TruncateString(input string) string
- func ValidateIANATimezone(iana string) (string, error)
- type AITimezoneResponse
- type AreaInterest
- type AreaInterestProps
- type AreaInterestResponse
- type Block
- type CheckboxFilter
- type Course
- type CourseProperties
- type CourseResponse
- type DatabaseQueryBody
- type Date
- type DateProp
- type EmailProp
- type Filter
- type FormattedText
- type FormattedTextSlice
- type GeneratedDeadline
- type GeneratedNote
- type GeneratedTask
- type GetTypeResponseBody
- type Icon
- type MarkdownRichText
- type NameProp
- type NameWriteProp
- type Note
- type NoteProperties
- type OAIMessage
- type OAIRequestBody
- type OAIResponseBody
- type Page
- type PageText
- type PageToken
- type ParentDatabase
- type Project
- type ProjectProperties
- type ProjectResponse
- type RelationProp
- type ResponseChoice
- type RichText
- type RichTextComponent
- type Select
- type SelectProp
- type StatusFilter
- type Task
- type TaskProperties
- type TextContent
- type TextProp
- type TextWrite
- type Token
- type TokenWrite
- type WebsiteProp
Constants ¶
View Source
const AgeRating = "\nAge Rating: I am 20 years old. Hence, do not censor your content on age."
View Source
const DeadlineTemplate = `` /* 541-byte string literal not displayed */
View Source
const InstructionPreamble = "\n\nYou were also provided with these instructions from the user:\n"
View Source
const NoteTemplate = ` You are an extension of me. You take message I send you and extract the data necessary to catalog it as a note in my Notion. Respond only with the following JSON format: { "emoji": "Add emoji. Use your sense of humor and be creative." "title": "Rewrite original note with context. Do not get creative. Do not begin with action verb", "description": "Similar to the sub-headline. Goes into more depth while remaining concise. One or two sentence max." "type": "Select a type from the ones listed below. If none match, return TBD. Note that areas/projects are not types.", "area": ["Add area ID if course is provided in original message.", "Can add more than one ID if provided in original message."], "project": ["Add project ID if course is provided in original message.", "Can add more than one ID if provided in original message."], } Context: - Types: *TYPES* - Areas: *AREAS* - Projects: *PROJECTS* ` + ProhibitedEmojis
View Source
const NotionDatabaseQueryEndpoint = "https://api.notion.com/v1/databases/*ID*/query"
View Source
const NotionPageCreationEndpoint = "https://api.notion.com/v1/pages"
View Source
const OpenAIEndpoint = "https://api.openai.com/v1/chat/completions"
View Source
const Personality = "" /* 128-byte string literal not displayed */
View Source
const PrimaryModel = "gpt-4o"
View Source
const ProhibitedEmojis = "\nProhibited Emojis: 📚, ✈️, 🫥, 👻, 💩, 🧮, ✏️, 🚀, 😆, 🎉, 🚘, 🤓"
View Source
const SecondaryModel = "gpt-4o-mini"
View Source
const SummarizationTemplate = `
You are tasked with condensing Markdown text. Summarize the file into a short paragraph on the main ideas of the text.
`
View Source
const SystemPrefix = "#system:"
View Source
const TaskTemplate = ` You act as my humorous and witty assistant. You take message I send you and extract the data necessary to catalog it as a task in my Notion. Respond only with the following JSON format: { "emoji": "Add emoji. Use your sense of humor. Rated 18+ (example: if party is mentioned, feel free to add liquor emoji, if context permits)" "task": "Enter extracted task. Do not add context that is listed below like due date or priority. Fix grammatical mistakes and never end in period. Ensure capitalization consistency.", "priority": A number between 1 and 4 with 1 being the highest priority. If not provided in message, then come up with one based on context., "body": "Add details if provided (don't add deadline / priority). May format/rewrite in Markdown (i.e, Markdown compatible).", "course": ["Add course ID if course is provided in message.", "Can add more than one ID if provided in message."], "project": ["Add project ID if project is provided in message.", "Can add more than one ID if provided in message."] } Context: - Date message was sent in ISO-8601: "*DATE*" - Day of week: *WEEKDAY* - Courses: *COURSES* - Projects: *PROJECTS* ` + ProhibitedEmojis + Personality + AgeRating
View Source
const TimezonePrefix = "#timezone:"
View Source
const TimezoneTemplate = `` /* 495-byte string literal not displayed */
View Source
const TypeTemplate = `` /* 328-byte string literal not displayed */
Variables ¶
View Source
var Databases = []string{"task", "note"}
Functions ¶
func ChannelLink ¶
func ClampString ¶
func ContextualizeLink ¶
func ConvertNumToPriority ¶
func CreateNote ¶
func CreateTask ¶
func ExtractLocationFromSMS ¶
func ExtractNoteTypes ¶
func ExtractSystemContent ¶
func ExtractTimezone ¶
func FetchNoteTypes ¶
func FetchPageContent ¶
func FetchYoutubeData ¶
func RemoveEmptyLines ¶
func RemoveEmptyStrings ¶
func RemoveIndex ¶
func RemoveInstruction ¶
func RemoveLeadingWhitespace ¶
func RemoveNewline ¶
func SetTimezoneFromLocation ¶
func TruncateString ¶
func ValidateIANATimezone ¶
Types ¶
type AITimezoneResponse ¶
type AreaInterest ¶
type AreaInterest struct { ID string `json:"id"` Properties AreaInterestProps `json:"properties"` URL string `json:"url"` }
func FetchAreasInterests ¶
func FetchAreasInterests(filter *Filter) ([]AreaInterest, error)
type AreaInterestProps ¶
type AreaInterestProps struct {
Name NameProp `json:"Name"`
}
type AreaInterestResponse ¶
type AreaInterestResponse struct {
AreasInterests []AreaInterest `json:"results"`
}
⬇️ Areas / Interests
type Block ¶
type Block struct { Object string `json:"object"` Type string `json:"type"` Paragraph *map[string]interface{} `json:"paragraph,omitempty"` Code *map[string]interface{} `json:"code,omitempty"` Heading1 *map[string]interface{} `json:"heading_1,omitempty"` Heading2 *map[string]interface{} `json:"heading_2,omitempty"` Heading3 *map[string]interface{} `json:"heading_3,omitempty"` Bullets *map[string]interface{} `json:"bulleted_list_item,omitempty"` NumberedList *map[string]interface{} `json:"numbered_list_item,omitempty"` ToDo *map[string]interface{} `json:"to_do,omitempty"` Quote *map[string]interface{} `json:"quote,omitempty"` }
func ConvertMarkdownToNotion ¶
func CreateBookmarksFromURLs ¶
type CheckboxFilter ¶
type CheckboxFilter struct {
Equals bool `json:"equals"`
}
type Course ¶
type Course struct { ID string `json:"id"` Properties CourseProperties `json:"properties"` URL string `json:"url"` }
func FetchCourses ¶
type CourseProperties ¶
type CourseResponse ¶
type CourseResponse struct {
Courses []Course `json:"results"`
}
type DatabaseQueryBody ¶
type DatabaseQueryBody struct {
Filter *Filter `json:"filter,omitempty"`
}
⬇️ Database Query Body
type Filter ¶
type Filter struct { Property string `json:"property"` Checkbox *CheckboxFilter `json:"checkbox,omitempty"` Status *StatusFilter `json:"status"` }
type FormattedText ¶
func FormatMarkdownParagraph ¶
func FormatMarkdownParagraph(input string) []FormattedText
func SortFormattedTexts ¶
func SortFormattedTexts(texts []FormattedText) []FormattedText
Function to sort and return a sorted slice
type FormattedTextSlice ¶
type FormattedTextSlice []FormattedText
func (FormattedTextSlice) Len ¶
func (s FormattedTextSlice) Len() int
func (FormattedTextSlice) Less ¶
func (s FormattedTextSlice) Less(i, j int) bool
func (FormattedTextSlice) Swap ¶
func (s FormattedTextSlice) Swap(i, j int)
type GeneratedDeadline ¶
type GeneratedDeadline struct {
Deadline string `json:"deadline"`
}
type GeneratedNote ¶
type GeneratedTask ¶
type GetTypeResponseBody ¶
type GetTypeResponseBody struct {
Type string `json:"type"`
}
type MarkdownRichText ¶
type NameWriteProp ¶
type NameWriteProp struct {
Title []TokenWrite `json:"title"`
}
type Note ¶
type Note struct { Parent ParentDatabase `json:"parent"` Icon Icon `json:"icon"` Properties NoteProperties `json:"properties"` Children []Block `json:"children"` }
type NoteProperties ¶
type NoteProperties struct { Name NameWriteProp `json:"Name"` Type SelectProp `json:"Type"` AreaInterest RelationProp `json:"Area / Interest"` Description RichText `json:"Description"` Project RelationProp `json:"Project"` }
type OAIMessage ¶
⬇️ OpenAI Types
type OAIRequestBody ¶
type OAIRequestBody struct { Model string `json:"model"` Messages []OAIMessage `json:"messages"` }
type OAIResponseBody ¶
type OAIResponseBody struct {
Choices []ResponseChoice `json:"choices"`
}
type ParentDatabase ¶
type Project ¶
type Project struct { ID string `json:"id"` Properties ProjectProperties `json:"properties"` URL string `json:"url"` }
func FetchProjects ¶
type ProjectProperties ¶
type ProjectProperties struct {
Name NameProp `json:"name"`
}
type ProjectResponse ¶
type ProjectResponse struct {
Projects []Project `json:"results"`
}
type RelationProp ¶
type RelationProp struct {
Pages []Page `json:"relation"`
}
type ResponseChoice ¶
type ResponseChoice struct {
Message OAIMessage `json:"message"`
}
type RichText ¶
type RichText struct {
Components []RichTextComponent `json:"rich_text"`
}
type RichTextComponent ¶
type RichTextComponent struct {
Text TextContent `json:"text"`
}
type SelectProp ¶
type SelectProp struct {
Select Select `json:"select"`
}
type StatusFilter ¶
type StatusFilter struct {
Equals string `json:"equals"`
}
type Task ¶
type Task struct { Parent ParentDatabase `json:"parent"` Icon Icon `json:"icon"` Properties TaskProperties `json:"properties"` Children []Block `json:"children"` }
type TaskProperties ¶
type TaskProperties struct { Name NameWriteProp `json:"Name"` Priority SelectProp `json:"Priority"` DueDate DateProp `json:"Due Date"` Course RelationProp `json:"Course"` Project RelationProp `json:"Project"` }
type TextContent ¶
type TextContent struct {
Content string `json:"content"`
}
type TokenWrite ¶
type TokenWrite struct {
Text TextWrite `json:"text"`
}
type WebsiteProp ¶
type WebsiteProp struct {
URL string `json:"url"`
}
Click to show internal directories.
Click to hide internal directories.