Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateSearchResult ¶
func ValidateSearchResult(result openai.VectorStoreSearchResponse) error
ValidateSearchResult checks the fields used to display a human-readable match.
Types ¶
type AttachOptions ¶
type AttachOptions struct {
Attributes map[string]any `json:"attributes,omitempty"`
Chunking map[string]any `json:"chunking_strategy,omitempty"`
}
AttachOptions uses the API defaults for fields left nil.
type FilePage ¶
type FilePage struct {
Files []openai.VectorStoreFile
Next string
}
type IndexedContent ¶
type Options ¶
type Options struct {
NewService func(context.Context, *cli.Command) (Service, error)
ErrorMessage func(error) string
}
Options keeps shared request configuration and safe error wording in assembly.
type SearchPage ¶
type SearchPage struct {
Results []openai.VectorStoreSearchResponse
More bool
}
SearchPage reports continuation without inventing an unsupported API input. The current search request has no cursor, although its response can report more.
type Service ¶
type Service interface {
ListStores(context.Context, string) (StorePage, error)
GetStore(context.Context, string) (*openai.VectorStore, error)
CreateStore(context.Context, string) (*openai.VectorStore, error)
UpdateStore(context.Context, string, map[string]any) (*openai.VectorStore, error)
DeleteStore(context.Context, string) error
ListFiles(context.Context, string, string) (FilePage, error)
ListSourceFiles(context.Context, string) (SourcePage, error)
UploadFile(context.Context, string) (*openai.FileObject, error)
AttachFile(context.Context, string, string, AttachOptions) (*openai.VectorStoreFile, error)
GetFile(context.Context, string, string) (*openai.VectorStoreFile, error)
UpdateFile(context.Context, string, string, map[string]any) (*openai.VectorStoreFile, error)
RemoveFile(context.Context, string, string) error
FileContent(context.Context, string, string) (IndexedContent, error)
CreateBatch(context.Context, string, []string, AttachOptions) (*openai.VectorStoreFileBatch, error)
GetBatch(context.Context, string, string) (*openai.VectorStoreFileBatch, error)
CancelBatch(context.Context, string, string) (*openai.VectorStoreFileBatch, error)
ListBatchFiles(context.Context, string, string, string) (FilePage, error)
Search(context.Context, string, string) (SearchPage, error)
}
Service separates request execution from terminal input and workspace state. Upload and attachment stay separate so a failed attachment retains its file ID.
func NewService ¶
NewService uses the client's existing authentication, transport, and request policies.
type SourcePage ¶
type SourcePage struct {
Files []openai.FileObject
Next string
}
type StorePage ¶
type StorePage struct {
Stores []openai.VectorStore
Next string
}
StorePage and FilePage retain the cursor for an explicit Load more action.