Documentation
¶
Index ¶
- func InitDB(options *models.Options) (*pgxpool.Pool, error)
- func VerifySchema(ctx context.Context, url string) error
- type APIStandard
- type DBTX
- type DeleteDocEmbeddingsParams
- type DeleteEmbeddingsByProjectParams
- type DeleteLLMParams
- type DeleteProjectParams
- type Embedding
- type GetAPIStandardsParams
- type GetEmbeddingsByProjectParams
- type GetEmbeddingsByProjectRow
- type GetKeysByLinkedUsersParams
- type GetKeysByLinkedUsersRow
- type GetLLMsByProjectParams
- type GetLLMsByUserParams
- type GetLLMsByUserRow
- type GetNumberOfEmbeddingsByProjectParams
- type GetProjectsByUserParams
- type GetProjectsByUserRow
- type GetSimilarsByIDParams
- type GetSimilarsByVectorParams
- type GetSimilarsByVectorRow
- type GetUsersByProjectParams
- type GetUsersByProjectRow
- type GetUsersParams
- type KeyMethod
- type LinkProjectToLLMParams
- type LinkProjectToUserParams
- type LinkUserToLLMParams
- type LlmService
- type Migrator
- type Project
- type ProjectsLlmService
- type Queries
- func (q *Queries) DeleteAPIStandard(ctx context.Context, apiStandardHandle string) error
- func (q *Queries) DeleteAllRecords(ctx context.Context) error
- func (q *Queries) DeleteDocEmbeddings(ctx context.Context, arg DeleteDocEmbeddingsParams) error
- func (q *Queries) DeleteEmbeddingsByID(ctx context.Context, embeddingsID int32) error
- func (q *Queries) DeleteEmbeddingsByProject(ctx context.Context, arg DeleteEmbeddingsByProjectParams) error
- func (q *Queries) DeleteLLM(ctx context.Context, arg DeleteLLMParams) error
- func (q *Queries) DeleteProject(ctx context.Context, arg DeleteProjectParams) error
- func (q *Queries) DeleteUser(ctx context.Context, userHandle string) error
- func (q *Queries) GetAPIStandards(ctx context.Context, arg GetAPIStandardsParams) ([]APIStandard, error)
- func (q *Queries) GetEmbeddingsByProject(ctx context.Context, arg GetEmbeddingsByProjectParams) ([]GetEmbeddingsByProjectRow, error)
- func (q *Queries) GetKeyByUser(ctx context.Context, userHandle string) (string, error)
- func (q *Queries) GetKeysByLinkedUsers(ctx context.Context, arg GetKeysByLinkedUsersParams) ([]GetKeysByLinkedUsersRow, error)
- func (q *Queries) GetLLMsByProject(ctx context.Context, arg GetLLMsByProjectParams) ([]LlmService, error)
- func (q *Queries) GetLLMsByUser(ctx context.Context, arg GetLLMsByUserParams) ([]GetLLMsByUserRow, error)
- func (q *Queries) GetNumberOfEmbeddingsByProject(ctx context.Context, arg GetNumberOfEmbeddingsByProjectParams) (int64, error)
- func (q *Queries) GetProjectsByUser(ctx context.Context, arg GetProjectsByUserParams) ([]GetProjectsByUserRow, error)
- func (q *Queries) GetSimilarsByID(ctx context.Context, arg GetSimilarsByIDParams) ([]pgtype.Text, error)
- func (q *Queries) GetSimilarsByVector(ctx context.Context, arg GetSimilarsByVectorParams) ([]GetSimilarsByVectorRow, error)
- func (q *Queries) GetUsers(ctx context.Context, arg GetUsersParams) ([]string, error)
- func (q *Queries) GetUsersByProject(ctx context.Context, arg GetUsersByProjectParams) ([]GetUsersByProjectRow, error)
- func (q *Queries) LinkProjectToLLM(ctx context.Context, arg LinkProjectToLLMParams) error
- func (q *Queries) LinkProjectToUser(ctx context.Context, arg LinkProjectToUserParams) (UsersProject, error)
- func (q *Queries) LinkUserToLLM(ctx context.Context, arg LinkUserToLLMParams) error
- func (q *Queries) ResetAllSerials(ctx context.Context) error
- func (q *Queries) RetrieveAPIStandard(ctx context.Context, apiStandardHandle string) (APIStandard, error)
- func (q *Queries) RetrieveEmbeddings(ctx context.Context, arg RetrieveEmbeddingsParams) (RetrieveEmbeddingsRow, error)
- func (q *Queries) RetrieveLLM(ctx context.Context, arg RetrieveLLMParams) (LlmService, error)
- func (q *Queries) RetrieveProject(ctx context.Context, arg RetrieveProjectParams) (Project, error)
- func (q *Queries) RetrieveUser(ctx context.Context, userHandle string) (User, error)
- func (q *Queries) UpsertAPIStandard(ctx context.Context, arg UpsertAPIStandardParams) (string, error)
- func (q *Queries) UpsertEmbeddings(ctx context.Context, arg UpsertEmbeddingsParams) (UpsertEmbeddingsRow, error)
- func (q *Queries) UpsertLLM(ctx context.Context, arg UpsertLLMParams) (UpsertLLMRow, error)
- func (q *Queries) UpsertProject(ctx context.Context, arg UpsertProjectParams) (UpsertProjectRow, error)
- func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) (User, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RetrieveEmbeddingsParams
- type RetrieveEmbeddingsRow
- type RetrieveLLMParams
- type RetrieveProjectParams
- type UpsertAPIStandardParams
- type UpsertEmbeddingsParams
- type UpsertEmbeddingsRow
- type UpsertLLMParams
- type UpsertLLMRow
- type UpsertProjectParams
- type UpsertProjectRow
- type UpsertUserParams
- type User
- type UsersLlmService
- type UsersProject
- type VdbRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIStandard ¶
type APIStandard struct {
APIStandardHandle string `db:"api_standard_handle" json:"api_standard_handle"`
Description pgtype.Text `db:"description" json:"description"`
KeyMethod string `db:"key_method" json:"key_method"`
KeyField pgtype.Text `db:"key_field" json:"key_field"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}
type DeleteLLMParams ¶
type DeleteProjectParams ¶
type Embedding ¶
type Embedding struct {
EmbeddingsID int32 `db:"embeddings_id" json:"embeddings_id"`
TextID pgtype.Text `db:"text_id" json:"text_id"`
Owner string `db:"owner" json:"owner"`
ProjectID int32 `db:"project_id" json:"project_id"`
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
Text pgtype.Text `db:"text" json:"text"`
Vector pgvector_go.HalfVector `db:"vector" json:"vector"`
VectorDim int32 `db:"vector_dim" json:"vector_dim"`
Metadata []byte `db:"metadata" json:"metadata"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}
type GetAPIStandardsParams ¶
type GetEmbeddingsByProjectRow ¶
type GetEmbeddingsByProjectRow struct {
EmbeddingsID int32 `db:"embeddings_id" json:"embeddings_id"`
TextID pgtype.Text `db:"text_id" json:"text_id"`
Owner string `db:"owner" json:"owner"`
ProjectID int32 `db:"project_id" json:"project_id"`
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
Text pgtype.Text `db:"text" json:"text"`
Vector pgvector_go.HalfVector `db:"vector" json:"vector"`
VectorDim int32 `db:"vector_dim" json:"vector_dim"`
Metadata []byte `db:"metadata" json:"metadata"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
ProjectHandle string `db:"project_handle" json:"project_handle"`
LLMServiceHandle string `db:"llm_service_handle" json:"llm_service_handle"`
}
type GetKeysByLinkedUsersRow ¶
type GetLLMsByProjectParams ¶
type GetLLMsByUserParams ¶
type GetLLMsByUserRow ¶
type GetLLMsByUserRow struct {
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
LLMServiceHandle string `db:"llm_service_handle" json:"llm_service_handle"`
Owner string `db:"owner" json:"owner"`
Endpoint string `db:"endpoint" json:"endpoint"`
Description pgtype.Text `db:"description" json:"description"`
APIKey pgtype.Text `db:"api_key" json:"api_key"`
APIStandard string `db:"api_standard" json:"api_standard"`
Model string `db:"model" json:"model"`
Dimensions int32 `db:"dimensions" json:"dimensions"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
Role string `db:"role" json:"role"`
}
type GetProjectsByUserParams ¶
type GetProjectsByUserRow ¶
type GetProjectsByUserRow struct {
ProjectID int32 `db:"project_id" json:"project_id"`
ProjectHandle string `db:"project_handle" json:"project_handle"`
Owner string `db:"owner" json:"owner"`
Description pgtype.Text `db:"description" json:"description"`
MetadataScheme pgtype.Text `db:"metadata_scheme" json:"metadata_scheme"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
Role string `db:"role" json:"role"`
}
type GetSimilarsByIDParams ¶
type GetSimilarsByIDParams struct {
TextID pgtype.Text `db:"text_id" json:"text_id"`
Owner string `db:"owner" json:"owner"`
ProjectHandle string `db:"project_handle" json:"project_handle"`
Column4 float64 `db:"column_4" json:"column_4"`
Limit int32 `db:"limit" json:"limit"`
Offset int32 `db:"offset" json:"offset"`
}
type GetSimilarsByVectorParams ¶
type GetSimilarsByVectorParams struct {
Vector pgvector_go.HalfVector `db:"vector" json:"vector"`
Limit int32 `db:"limit" json:"limit"`
Offset int32 `db:"offset" json:"offset"`
}
type GetSimilarsByVectorRow ¶
type GetUsersByProjectParams ¶
type GetUsersByProjectRow ¶
type GetUsersParams ¶
type LinkProjectToLLMParams ¶
type LinkProjectToUserParams ¶
type LinkUserToLLMParams ¶
type LlmService ¶
type LlmService struct {
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
LLMServiceHandle string `db:"llm_service_handle" json:"llm_service_handle"`
Owner string `db:"owner" json:"owner"`
Endpoint string `db:"endpoint" json:"endpoint"`
Description pgtype.Text `db:"description" json:"description"`
APIKey pgtype.Text `db:"api_key" json:"api_key"`
APIStandard string `db:"api_standard" json:"api_standard"`
Model string `db:"model" json:"model"`
Dimensions int32 `db:"dimensions" json:"dimensions"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func (Migrator) Info ¶
Info the current migration version and the embedded maximum migration, and a textual representation of the migration state for informational purposes.
type Project ¶
type Project struct {
ProjectID int32 `db:"project_id" json:"project_id"`
ProjectHandle string `db:"project_handle" json:"project_handle"`
Owner string `db:"owner" json:"owner"`
Description pgtype.Text `db:"description" json:"description"`
MetadataScheme pgtype.Text `db:"metadata_scheme" json:"metadata_scheme"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}
type ProjectsLlmService ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteAPIStandard ¶
func (*Queries) DeleteDocEmbeddings ¶
func (q *Queries) DeleteDocEmbeddings(ctx context.Context, arg DeleteDocEmbeddingsParams) error
func (*Queries) DeleteEmbeddingsByID ¶
func (*Queries) DeleteEmbeddingsByProject ¶
func (q *Queries) DeleteEmbeddingsByProject(ctx context.Context, arg DeleteEmbeddingsByProjectParams) error
func (*Queries) DeleteLLM ¶
func (q *Queries) DeleteLLM(ctx context.Context, arg DeleteLLMParams) error
func (*Queries) DeleteProject ¶
func (q *Queries) DeleteProject(ctx context.Context, arg DeleteProjectParams) error
func (*Queries) DeleteUser ¶
func (*Queries) GetAPIStandards ¶
func (q *Queries) GetAPIStandards(ctx context.Context, arg GetAPIStandardsParams) ([]APIStandard, error)
func (*Queries) GetEmbeddingsByProject ¶
func (q *Queries) GetEmbeddingsByProject(ctx context.Context, arg GetEmbeddingsByProjectParams) ([]GetEmbeddingsByProjectRow, error)
func (*Queries) GetKeyByUser ¶
SELECT encode("vdb_api_key", 'hex') AS "vdb_api_key" FROM users
func (*Queries) GetKeysByLinkedUsers ¶
func (q *Queries) GetKeysByLinkedUsers(ctx context.Context, arg GetKeysByLinkedUsersParams) ([]GetKeysByLinkedUsersRow, error)
SELECT users."user_handle", users_projects."role", encode(users."vdb_api_key", 'hex') AS "vdb_api_key"
func (*Queries) GetLLMsByProject ¶
func (q *Queries) GetLLMsByProject(ctx context.Context, arg GetLLMsByProjectParams) ([]LlmService, error)
func (*Queries) GetLLMsByUser ¶
func (q *Queries) GetLLMsByUser(ctx context.Context, arg GetLLMsByUserParams) ([]GetLLMsByUserRow, error)
func (*Queries) GetNumberOfEmbeddingsByProject ¶
func (*Queries) GetProjectsByUser ¶
func (q *Queries) GetProjectsByUser(ctx context.Context, arg GetProjectsByUserParams) ([]GetProjectsByUserRow, error)
func (*Queries) GetSimilarsByID ¶
func (q *Queries) GetSimilarsByID(ctx context.Context, arg GetSimilarsByIDParams) ([]pgtype.Text, error)
1 - (e1.vector <=> e2.vector) AS cosine_similarity
func (*Queries) GetSimilarsByVector ¶
func (q *Queries) GetSimilarsByVector(ctx context.Context, arg GetSimilarsByVectorParams) ([]GetSimilarsByVectorRow, error)
func (*Queries) GetUsersByProject ¶
func (q *Queries) GetUsersByProject(ctx context.Context, arg GetUsersByProjectParams) ([]GetUsersByProjectRow, error)
func (*Queries) LinkProjectToLLM ¶
func (q *Queries) LinkProjectToLLM(ctx context.Context, arg LinkProjectToLLMParams) error
func (*Queries) LinkProjectToUser ¶
func (q *Queries) LinkProjectToUser(ctx context.Context, arg LinkProjectToUserParams) (UsersProject, error)
func (*Queries) LinkUserToLLM ¶
func (q *Queries) LinkUserToLLM(ctx context.Context, arg LinkUserToLLMParams) error
func (*Queries) RetrieveAPIStandard ¶
func (*Queries) RetrieveEmbeddings ¶
func (q *Queries) RetrieveEmbeddings(ctx context.Context, arg RetrieveEmbeddingsParams) (RetrieveEmbeddingsRow, error)
func (*Queries) RetrieveLLM ¶
func (q *Queries) RetrieveLLM(ctx context.Context, arg RetrieveLLMParams) (LlmService, error)
func (*Queries) RetrieveProject ¶
func (*Queries) RetrieveUser ¶
func (*Queries) UpsertAPIStandard ¶
func (*Queries) UpsertEmbeddings ¶
func (q *Queries) UpsertEmbeddings(ctx context.Context, arg UpsertEmbeddingsParams) (UpsertEmbeddingsRow, error)
func (*Queries) UpsertLLM ¶
func (q *Queries) UpsertLLM(ctx context.Context, arg UpsertLLMParams) (UpsertLLMRow, error)
func (*Queries) UpsertProject ¶
func (q *Queries) UpsertProject(ctx context.Context, arg UpsertProjectParams) (UpsertProjectRow, error)
func (*Queries) UpsertUser ¶
Generate go code with: sqlc generate
$1, $2, $3, (decode(sqlc.arg(vdb_api_key)::bytea, 'hex')), NOW(), NOW()
type RetrieveEmbeddingsRow ¶
type RetrieveEmbeddingsRow struct {
EmbeddingsID int32 `db:"embeddings_id" json:"embeddings_id"`
TextID pgtype.Text `db:"text_id" json:"text_id"`
Owner string `db:"owner" json:"owner"`
ProjectID int32 `db:"project_id" json:"project_id"`
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
Text pgtype.Text `db:"text" json:"text"`
Vector pgvector_go.HalfVector `db:"vector" json:"vector"`
VectorDim int32 `db:"vector_dim" json:"vector_dim"`
Metadata []byte `db:"metadata" json:"metadata"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
ProjectHandle string `db:"project_handle" json:"project_handle"`
LLMServiceHandle string `db:"llm_service_handle" json:"llm_service_handle"`
}
type RetrieveLLMParams ¶
type RetrieveProjectParams ¶
type UpsertAPIStandardParams ¶
type UpsertEmbeddingsParams ¶
type UpsertEmbeddingsParams struct {
TextID pgtype.Text `db:"text_id" json:"text_id"`
Owner string `db:"owner" json:"owner"`
ProjectID int32 `db:"project_id" json:"project_id"`
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
Text pgtype.Text `db:"text" json:"text"`
Vector pgvector_go.HalfVector `db:"vector" json:"vector"`
VectorDim int32 `db:"vector_dim" json:"vector_dim"`
Metadata []byte `db:"metadata" json:"metadata"`
}
type UpsertEmbeddingsRow ¶
type UpsertLLMParams ¶
type UpsertLLMParams struct {
Owner string `db:"owner" json:"owner"`
LLMServiceHandle string `db:"llm_service_handle" json:"llm_service_handle"`
Endpoint string `db:"endpoint" json:"endpoint"`
Description pgtype.Text `db:"description" json:"description"`
APIKey pgtype.Text `db:"api_key" json:"api_key"`
APIStandard string `db:"api_standard" json:"api_standard"`
Model string `db:"model" json:"model"`
Dimensions int32 `db:"dimensions" json:"dimensions"`
}
type UpsertLLMRow ¶
type UpsertProjectParams ¶
type UpsertProjectRow ¶
type UpsertUserParams ¶
type User ¶
type User struct {
UserHandle string `db:"user_handle" json:"user_handle"`
Name pgtype.Text `db:"name" json:"name"`
Email string `db:"email" json:"email"`
VdbAPIKey string `db:"vdb_api_key" json:"vdb_api_key"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}
type UsersLlmService ¶
type UsersLlmService struct {
UserHandle string `db:"user_handle" json:"user_handle"`
LLMServiceID int32 `db:"llm_service_id" json:"llm_service_id"`
Role string `db:"role" json:"role"`
CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}
type UsersProject ¶
Click to show internal directories.
Click to hide internal directories.