Documentation ¶
Index ¶
- Constants
- Variables
- func FormParseVerify(form form.Form, name string, w http.ResponseWriter, r *http.Request) errorlist.Errors
- func QuestionHandler(w http.ResponseWriter, r *http.Request)
- func Run(openaiClient *openai.Client, pineconeApiKey string, pineconeApiEndpoint string)
- func UploadHandler(w http.ResponseWriter, r *http.Request)
- type Answer
- type Chunk
- type Config
- type Context
- type OpenAIResponse
- type PineconeQueryItem
- type PineconeQueryMatch
- type PineconeQueryRequest
- type PineconeQueryResponse
- type PineconeQueryResponseResult
- type PineconeVector
- type UploadResponse
Constants ¶
View Source
const EmbeddingModel = "text-embedding-ada-002"
View Source
const MAX_FILE_SIZE int64 = 3 << 20 // 3 MB
View Source
const MAX_TOTAL_UPLOAD_SIZE int64 = 3 << 20 // 3 MB
View Source
const MaxTokensPerChunk = 1500
MaxTokensPerChunk is the maximum number of tokens allowed in a single chunk for OpenAI embeddings MaxTokensPerChunk is the maximum number of tokens allowed in a single chunk for OpenAI embeddings
Variables ¶
View Source
var ( CONFIG = serverutil.GetConfig() C *cache.Cache DEFAULT_OPENAI_CLIENT *openai.Client PINECONE_API_KEY = "" PINECONE_API_ENDPOINT = "" )
Functions ¶
func FormParseVerify ¶
func FormParseVerify(form form.Form, name string, w http.ResponseWriter, r *http.Request) errorlist.Errors
Util: does grunt work of decoding + verifying form + writing errors back
func QuestionHandler ¶
func QuestionHandler(w http.ResponseWriter, r *http.Request)
Handle Requests For Question
func UploadHandler ¶
func UploadHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type OpenAIResponse ¶
type PineconeQueryItem ¶
type PineconeQueryItem struct {
Values []float32 `json:"values"`
}
type PineconeQueryMatch ¶
type PineconeQueryRequest ¶
type PineconeQueryRequest struct { TopK int `json:"topK"` IncludeMetadata bool `json:"includeMetadata"` Namespace string `json:"namespace"` Queries []PineconeQueryItem `json:"queries"` }
type PineconeQueryResponse ¶
type PineconeQueryResponse struct {
Results []PineconeQueryResponseResult `json:"results"`
}
type PineconeQueryResponseResult ¶
type PineconeQueryResponseResult struct {
Matches []PineconeQueryMatch `json:"matches"`
}
type PineconeVector ¶
type UploadResponse ¶
Click to show internal directories.
Click to hide internal directories.