smr

package
v0.13.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNetworkError        = errors.New("network error")
	ErrRequestFailed       = errors.New("request failed")
	ErrContentNotSupported = errors.New("content not supported")
)

Functions

func NewModel

func NewModel() func(NewModelParams) *Model

Types

type FromPlatform

type FromPlatform int
const (
	FromPlatformTelegram FromPlatform = iota
	FromPlatformSlack
	FromPlatformDiscord
)

type Model

type Model struct {
	// contains filtered or unexported fields
}

func (*Model) SummarizeInputURL

func (m *Model) SummarizeInputURL(ctx context.Context, url string, fromPlatform FromPlatform) (*URLSummarizationOutput, error)

type NewModelParams

type NewModelParams struct {
	fx.In

	OpenAIClient openai.Client
	Logger       *logger.Logger
	Ent          *datastore.Ent
}

type URLSummarizationOutput

type URLSummarizationOutput struct {
	URL   string
	Title string
	Msg   string
}

func (*URLSummarizationOutput) FormatSummarizationAsDiscordMarkdown

func (u *URLSummarizationOutput) FormatSummarizationAsDiscordMarkdown() string

FormatSummarizationAsDiscordMarkdown the link syntax is not support for all servers currently.

func (*URLSummarizationOutput) FormatSummarizationAsHTML

func (u *URLSummarizationOutput) FormatSummarizationAsHTML() string

func (*URLSummarizationOutput) FormatSummarizationAsSlackMarkdown

func (u *URLSummarizationOutput) FormatSummarizationAsSlackMarkdown() string

FormatSummarizationAsSlackMarkdown the link syntax in slack markdown flavor is different than standard.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL