Documentation
¶
Index ¶
- Constants
- type ChangeToneContext
- type ContinueWritingContext
- type HelpDraftContext
- type HelpEditContext
- type NotionAIResp
- type NotionClient
- func (cli *NotionClient) ChangeTone(tone common.SupportedTone, content string) (string, error)
- func (cli *NotionClient) ContinueWriting(content string) (string, error)
- func (cli *NotionClient) HelpMeDraft(prompt string) (string, error)
- func (cli *NotionClient) HelpMeEdit(content, prompt string) (string, error)
- func (cli *NotionClient) Post(req *NotionRequest) (string, error)
- func (cli *NotionClient) Translate(lang common.SupportedLanguage, content string) (string, error)
- func (cli *NotionClient) WriteWithPrompt(promptType common.PromptType, content string) (string, error)
- func (cli *NotionClient) WriteWithTopic(topic common.TopicType, prompt string) (string, error)
- type NotionContext
- type NotionRequest
- type PromptContext
- type TopicContext
- type TranslateContext
Constants ¶
View Source
const ( UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3483.0 Safari/537.36" API = "https://www.notion.so/api/v3/getCompletion" OpenAIModel = "openai-3" )
View Source
const ChangeTone = "changeTone"
View Source
const ContinueWriting = "continueWriting"
View Source
const Translate = "Translate"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeToneContext ¶
type ChangeToneContext struct { Text string `json:"text"` Tone common.SupportedTone `json:"tone"` Type string `json:"type"` }
type ContinueWritingContext ¶
type HelpDraftContext ¶
type HelpDraftContext struct { Prompt string `json:"prompt"` Type common.PromptType `json:"type"` }
type HelpEditContext ¶
type HelpEditContext struct { Prompt string `json:"prompt"` Type common.PromptType `json:"type"` SelectedText string `json:"selectedText"` }
type NotionAIResp ¶
type NotionClient ¶
type NotionClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(token, spaceID string) *NotionClient
func (*NotionClient) ChangeTone ¶
func (cli *NotionClient) ChangeTone(tone common.SupportedTone, content string) (string, error)
ChangeTone uses specific tones to optimize content.
func (*NotionClient) ContinueWriting ¶
func (cli *NotionClient) ContinueWriting(content string) (string, error)
ContinueWriting can generate the following content based on the given input content.
func (*NotionClient) HelpMeDraft ¶
func (cli *NotionClient) HelpMeDraft(prompt string) (string, error)
HelpMeDraft can generate a draft based on the given prompt.
func (*NotionClient) HelpMeEdit ¶
func (cli *NotionClient) HelpMeEdit(content, prompt string) (string, error)
HelpMeEdit can optimize content based on the given prompt.
func (*NotionClient) Post ¶
func (cli *NotionClient) Post(req *NotionRequest) (string, error)
func (*NotionClient) Translate ¶
func (cli *NotionClient) Translate(lang common.SupportedLanguage, content string) (string, error)
Translate will translate the content to given language
func (*NotionClient) WriteWithPrompt ¶
func (cli *NotionClient) WriteWithPrompt(promptType common.PromptType, content string) (string, error)
WriteWithPrompt writes with special prompt, like summarize, explain_this, improve_writing
func (*NotionClient) WriteWithTopic ¶
WriteWithTopic writes for special topic, like Blog, Essay, Todo lis
type NotionContext ¶
type NotionContext interface{}
type NotionRequest ¶
type NotionRequest struct { Context NotionContext `json:"context"` ID string `json:"id"` IsSpacePermission bool `json:"isSpacePermission"` Model string `json:"model"` SpaceId string `json:"spaceId"` }
type PromptContext ¶
type PromptContext struct { SelectedText string `json:"selectedText"` Type common.PromptType `json:"type"` }
type TopicContext ¶
type TranslateContext ¶
type TranslateContext struct { Text string `json:"text"` Language common.SupportedLanguage `json:"language"` Type string `json:"type"` }
Click to show internal directories.
Click to hide internal directories.