rss2tg

package
v0.0.0-...-04b93b3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeedItems

func FeedItems(u string, words []string) error

func OpenAISum

func OpenAISum(token, text string) (string, error)

func RssList

func RssList(path string) ([]string, error)

RssList return array links on rss or error if link nor parcelable

func TgTextSend

func TgTextSend(botId, apiKey, chatId, text string) error

func WordsCheck

func WordsCheck(txt string, words []string) (intersect []string, err error)

func WordsList

func WordsList(path string) ([]string, error)

WordsList return lowercase words

Types

type OpenAIReq

type OpenAIReq struct {
	Model            string  `json:"model"`
	Prompt           string  `json:"prompt"`
	Temperature      float64 `json:"temperature"`
	MaxTokens        int     `json:"max_tokens"`
	TopP             float64 `json:"top_p"`
	FrequencyPenalty float64 `json:"frequency_penalty"`
	PresencePenalty  float64 `json:"presence_penalty"`
}

type OpenAIResp

type OpenAIResp struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int    `json:"created"`
	Model   string `json:"model"`
	Choices []struct {
		Text         string      `json:"text"`
		Index        int         `json:"index"`
		Logprobs     interface{} `json:"logprobs"`
		FinishReason string      `json:"finish_reason"`
	} `json:"choices"`
	Usage struct {
		PromptTokens     int `json:"prompt_tokens"`
		CompletionTokens int `json:"completion_tokens"`
		TotalTokens      int `json:"total_tokens"`
	} `json:"usage"`
}

Jump to

Keyboard shortcuts

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