handlers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExistingTagToThread

func AddExistingTagToThread(threadId string, tagId string, c echo.Context, app *pocketbase.PocketBase) error

func CreateApi

func CreateApi(c echo.Context, app *pocketbase.PocketBase) error

create new API definition

func CreateTag

func CreateTag(threadId string, c echo.Context, app *pocketbase.PocketBase) error

func CreateThread

func CreateThread(c echo.Context, app *pocketbase.PocketBase) error

func DeleteApi

func DeleteApi(modelId string, c echo.Context, app *pocketbase.PocketBase) error

delete API definition

func DeleteTag

func DeleteTag(tagId string, c echo.Context, app *pocketbase.PocketBase) error

func DeleteThread

func DeleteThread(threadId string, c echo.Context, app *pocketbase.PocketBase) error

func EditThreadTitle

func EditThreadTitle(id string, c echo.Context, app *pocketbase.PocketBase) error

func GetModelStats

func GetModelStats(c echo.Context, app *pocketbase.PocketBase) error

func GetThread

func GetThread(id string, c echo.Context, app *pocketbase.PocketBase) error

func GetThreadList

func GetThreadList(sortMethod string, c echo.Context, app *pocketbase.PocketBase) error

func InitializeChat

func InitializeChat(c echo.Context, app *pocketbase.PocketBase) error

func LoadApiModels

func LoadApiModels(modelId string, c echo.Context, app *pocketbase.PocketBase) error

populate the chat model select

func LoadApis

func LoadApis(c echo.Context, app *pocketbase.PocketBase) error

populate the chat API select

func LoadThreadTags

func LoadThreadTags(id string, app *pocketbase.PocketBase) ([]templates.TagParams, error)

func ModelsUnavailableResponse

func ModelsUnavailableResponse(c echo.Context) error

func OpenApiEditor

func OpenApiEditor(c echo.Context, app *pocketbase.PocketBase) error

open the API editor in the sidebar

func OpenChatSocket

func OpenChatSocket(selectedModel *string, c echo.Context, app *pocketbase.PocketBase) error

func OpenConfig

func OpenConfig(c echo.Context, app *pocketbase.PocketBase) error

func OpenSearch

func OpenSearch(c echo.Context, app *pocketbase.PocketBase) error

func OpenTagModifier

func OpenTagModifier(tagId string, threadId string, c echo.Context, app *pocketbase.PocketBase) error

func RemoveTagFromThread

func RemoveTagFromThread(threadId string, tagId string, c echo.Context, app *pocketbase.PocketBase) error

func SaveTag

func SaveTag(threadId string, data map[string]any, c echo.Context, app *pocketbase.PocketBase) error

func SaveThreadTitle

func SaveThreadTitle(id string, title string, c echo.Context, app *pocketbase.PocketBase) error
func Search(data map[string]any, c echo.Context, app *pocketbase.PocketBase) error

func SelectApi

func SelectApi(id string, selectedModel *string, c echo.Context, app *pocketbase.PocketBase) error

set current API

func SelectModel

func SelectModel(selectedModel string, c echo.Context, app *pocketbase.PocketBase) error

func ToggleMessageUsefulness

func ToggleMessageUsefulness(messageId string, c echo.Context, app *pocketbase.PocketBase) error

func UpdateApi

func UpdateApi(id string, data map[string]any, c echo.Context, app *pocketbase.PocketBase) error

update API definition

func UpdateTag

func UpdateTag(tagId string, data map[string]any, c echo.Context, app *pocketbase.PocketBase) error

Types

type ApiModel

type ApiModel struct {
	Id            string `json:"id"`
	Object        string `json:"object"`
	Created       int64  `json:"created"`
	OwnedBy       string `json:"owned_by"`
	Active        bool   `json:"active"`
	ContextWindow int    `json:"context_window"`
	PublicApps    any    `json:"public_apps"`
}

type ApiNamesResponse

type ApiNamesResponse struct {
	Object string     `json:"object"`
	Data   []ApiModel `json:"data"`
}

types for parsing API /models endpoint response

type HTMXSocketMsg

type HTMXSocketMsg struct {
	Headers  map[string]string `json:"HEADERS"`
	Msg      string            `json:"new-message"`
	ThreadId string            `json:"thread-id-chat"`
}

Jump to

Keyboard shortcuts

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