File: chat_interface.go

package info (click to toggle)
golang-github-meilisearch-meilisearch-go 0.33.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 956 kB
  • sloc: makefile: 9
file content (39 lines) | stat: -rw-r--r-- 2,226 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package meilisearch

import "context"

type ChatManager interface {
	ChatReader

	// UpdateChatWorkspace updates a chat workspace by its ID.
	UpdateChatWorkspace(uid string, settings *ChatWorkspaceSettings) (*ChatWorkspaceSettings, error)
	// UpdateChatWorkspaceWithContext updates a chat workspace by its ID with a context.
	UpdateChatWorkspaceWithContext(ctx context.Context, uid string, settings *ChatWorkspaceSettings) (*ChatWorkspaceSettings, error)

	// ResetChatWorkspace resets a chat workspace by its ID.
	ResetChatWorkspace(uid string) (*ChatWorkspaceSettings, error)
	// ResetChatWorkspaceWithContext resets a chat workspace by its ID with a context.
	ResetChatWorkspaceWithContext(ctx context.Context, uid string) (*ChatWorkspaceSettings, error)
}

type ChatReader interface {
	// ChatCompletionStream retrieves a stream of chat completions for a given workspace and query.
	ChatCompletionStream(workspace string, query *ChatCompletionQuery) (*Stream[*ChatCompletionStreamChunk], error)
	// ChatCompletionStreamWithContext retrieves a stream of chat completions for a given workspace and query with a context.
	ChatCompletionStreamWithContext(ctx context.Context, workspace string, query *ChatCompletionQuery) (*Stream[*ChatCompletionStreamChunk], error)

	// ListChatWorkspaces retrieves all chat workspaces.
	ListChatWorkspaces(query *ListChatWorkSpaceQuery) (*ListChatWorkspace, error)
	// ListChatWorkspacesWithContext retrieves all chat workspaces with a context.
	ListChatWorkspacesWithContext(ctx context.Context, query *ListChatWorkSpaceQuery) (*ListChatWorkspace, error)

	// GetChatWorkspace retrieves a chat workspace by its ID.
	GetChatWorkspace(uid string) (*ChatWorkspace, error)
	// GetChatWorkspaceWithContext retrieves a chat workspace by its ID with a context.
	GetChatWorkspaceWithContext(ctx context.Context, uid string) (*ChatWorkspace, error)

	// GetChatWorkspaceSettings retrieves chat workspace settings by its ID.
	GetChatWorkspaceSettings(uid string) (*ChatWorkspaceSettings, error)
	// GetChatWorkspaceSettingsWithContext retrieves chat workspace settings by its ID with a context.
	GetChatWorkspaceSettingsWithContext(ctx context.Context, uid string) (*ChatWorkspaceSettings, error)
}