mirror of
https://github.com/hanzoai/llm-toolchain.git
synced 2026-10-30 18:29:08 +00:00
917 lines
32 KiB
Go
917 lines
32 KiB
Go
// Code generated by zapgen; DO NOT EDIT.
|
|
// source: llm-toolchain.zap
|
|
|
|
package llmtc
|
|
|
|
import (
|
|
zap "github.com/zap-proto/go"
|
|
)
|
|
|
|
const (
|
|
projectScopeProjectIdOff = 0
|
|
projectScopeSize = 8
|
|
)
|
|
|
|
// ProjectScope is a zero-copy view into a ZAP-encoded ProjectScope message.
|
|
type ProjectScope struct{ o zap.Object }
|
|
|
|
// WrapProjectScope parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapProjectScope(b []byte) (ProjectScope, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ProjectScope{}, err
|
|
}
|
|
return ProjectScope{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ProjectScope) ProjectId() string { return t.o.Text(projectScopeProjectIdOff) }
|
|
|
|
// ProjectScopeInput collects the field values for NewProjectScope.
|
|
type ProjectScopeInput struct {
|
|
ProjectId string
|
|
}
|
|
|
|
// NewProjectScope builds a ZAP-encoded ProjectScope message from in and returns the bytes.
|
|
func NewProjectScope(in ProjectScopeInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(projectScopeSize)
|
|
ob.SetText(projectScopeProjectIdOff, in.ProjectId)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
idScopeProjectIdOff = 0
|
|
idScopeIdOff = 8
|
|
idScopeSize = 16
|
|
)
|
|
|
|
// IdScope is a zero-copy view into a ZAP-encoded IdScope message.
|
|
type IdScope struct{ o zap.Object }
|
|
|
|
// WrapIdScope parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapIdScope(b []byte) (IdScope, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return IdScope{}, err
|
|
}
|
|
return IdScope{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t IdScope) ProjectId() string { return t.o.Text(idScopeProjectIdOff) }
|
|
func (t IdScope) Id() string { return t.o.Text(idScopeIdOff) }
|
|
|
|
// IdScopeInput collects the field values for NewIdScope.
|
|
type IdScopeInput struct {
|
|
ProjectId string
|
|
Id string
|
|
}
|
|
|
|
// NewIdScope builds a ZAP-encoded IdScope message from in and returns the bytes.
|
|
func NewIdScope(in IdScopeInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(idScopeSize)
|
|
ob.SetText(idScopeProjectIdOff, in.ProjectId)
|
|
ob.SetText(idScopeIdOff, in.Id)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
keyCreateParamsProjectIdOff = 0
|
|
keyCreateParamsProviderOff = 8
|
|
keyCreateParamsAdapterOff = 16
|
|
keyCreateParamsSecretKeyOff = 24
|
|
keyCreateParamsBaseURLOff = 32
|
|
keyCreateParamsWithDefaultModelsOff = 40
|
|
keyCreateParamsCustomModelsOff = 44
|
|
keyCreateParamsConfigOff = 52
|
|
keyCreateParamsExtraHeadersOff = 60
|
|
keyCreateParamsSize = 68
|
|
)
|
|
|
|
// KeyCreateParams is a zero-copy view into a ZAP-encoded KeyCreateParams message.
|
|
type KeyCreateParams struct{ o zap.Object }
|
|
|
|
// WrapKeyCreateParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapKeyCreateParams(b []byte) (KeyCreateParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return KeyCreateParams{}, err
|
|
}
|
|
return KeyCreateParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t KeyCreateParams) ProjectId() string { return t.o.Text(keyCreateParamsProjectIdOff) }
|
|
func (t KeyCreateParams) Provider() string { return t.o.Text(keyCreateParamsProviderOff) }
|
|
func (t KeyCreateParams) Adapter() string { return t.o.Text(keyCreateParamsAdapterOff) }
|
|
func (t KeyCreateParams) SecretKey() string { return t.o.Text(keyCreateParamsSecretKeyOff) }
|
|
func (t KeyCreateParams) BaseURL() string { return t.o.Text(keyCreateParamsBaseURLOff) }
|
|
func (t KeyCreateParams) WithDefaultModels() bool {
|
|
return t.o.Bool(keyCreateParamsWithDefaultModelsOff)
|
|
}
|
|
func (t KeyCreateParams) CustomModels() string { return t.o.Text(keyCreateParamsCustomModelsOff) }
|
|
func (t KeyCreateParams) Config() string { return t.o.Text(keyCreateParamsConfigOff) }
|
|
func (t KeyCreateParams) ExtraHeaders() string { return t.o.Text(keyCreateParamsExtraHeadersOff) }
|
|
|
|
// KeyCreateParamsInput collects the field values for NewKeyCreateParams.
|
|
type KeyCreateParamsInput struct {
|
|
ProjectId string
|
|
Provider string
|
|
Adapter string
|
|
SecretKey string
|
|
BaseURL string
|
|
WithDefaultModels bool
|
|
CustomModels string
|
|
Config string
|
|
ExtraHeaders string
|
|
}
|
|
|
|
// NewKeyCreateParams builds a ZAP-encoded KeyCreateParams message from in and returns the bytes.
|
|
func NewKeyCreateParams(in KeyCreateParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(keyCreateParamsSize)
|
|
ob.SetText(keyCreateParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(keyCreateParamsProviderOff, in.Provider)
|
|
ob.SetText(keyCreateParamsAdapterOff, in.Adapter)
|
|
ob.SetText(keyCreateParamsSecretKeyOff, in.SecretKey)
|
|
ob.SetText(keyCreateParamsBaseURLOff, in.BaseURL)
|
|
ob.SetBool(keyCreateParamsWithDefaultModelsOff, in.WithDefaultModels)
|
|
ob.SetText(keyCreateParamsCustomModelsOff, in.CustomModels)
|
|
ob.SetText(keyCreateParamsConfigOff, in.Config)
|
|
ob.SetText(keyCreateParamsExtraHeadersOff, in.ExtraHeaders)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
keyUpdateParamsProjectIdOff = 0
|
|
keyUpdateParamsIdOff = 8
|
|
keyUpdateParamsProviderOff = 16
|
|
keyUpdateParamsAdapterOff = 24
|
|
keyUpdateParamsHasSecretKeyOff = 32
|
|
keyUpdateParamsSecretKeyOff = 36
|
|
keyUpdateParamsBaseURLOff = 44
|
|
keyUpdateParamsWithDefaultModelsOff = 52
|
|
keyUpdateParamsCustomModelsOff = 56
|
|
keyUpdateParamsConfigOff = 64
|
|
keyUpdateParamsExtraHeadersOff = 72
|
|
keyUpdateParamsSize = 80
|
|
)
|
|
|
|
// KeyUpdateParams is a zero-copy view into a ZAP-encoded KeyUpdateParams message.
|
|
type KeyUpdateParams struct{ o zap.Object }
|
|
|
|
// WrapKeyUpdateParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapKeyUpdateParams(b []byte) (KeyUpdateParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return KeyUpdateParams{}, err
|
|
}
|
|
return KeyUpdateParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t KeyUpdateParams) ProjectId() string { return t.o.Text(keyUpdateParamsProjectIdOff) }
|
|
func (t KeyUpdateParams) Id() string { return t.o.Text(keyUpdateParamsIdOff) }
|
|
func (t KeyUpdateParams) Provider() string { return t.o.Text(keyUpdateParamsProviderOff) }
|
|
func (t KeyUpdateParams) Adapter() string { return t.o.Text(keyUpdateParamsAdapterOff) }
|
|
func (t KeyUpdateParams) HasSecretKey() bool { return t.o.Bool(keyUpdateParamsHasSecretKeyOff) }
|
|
func (t KeyUpdateParams) SecretKey() string { return t.o.Text(keyUpdateParamsSecretKeyOff) }
|
|
func (t KeyUpdateParams) BaseURL() string { return t.o.Text(keyUpdateParamsBaseURLOff) }
|
|
func (t KeyUpdateParams) WithDefaultModels() bool {
|
|
return t.o.Bool(keyUpdateParamsWithDefaultModelsOff)
|
|
}
|
|
func (t KeyUpdateParams) CustomModels() string { return t.o.Text(keyUpdateParamsCustomModelsOff) }
|
|
func (t KeyUpdateParams) Config() string { return t.o.Text(keyUpdateParamsConfigOff) }
|
|
func (t KeyUpdateParams) ExtraHeaders() string { return t.o.Text(keyUpdateParamsExtraHeadersOff) }
|
|
|
|
// KeyUpdateParamsInput collects the field values for NewKeyUpdateParams.
|
|
type KeyUpdateParamsInput struct {
|
|
ProjectId string
|
|
Id string
|
|
Provider string
|
|
Adapter string
|
|
HasSecretKey bool
|
|
SecretKey string
|
|
BaseURL string
|
|
WithDefaultModels bool
|
|
CustomModels string
|
|
Config string
|
|
ExtraHeaders string
|
|
}
|
|
|
|
// NewKeyUpdateParams builds a ZAP-encoded KeyUpdateParams message from in and returns the bytes.
|
|
func NewKeyUpdateParams(in KeyUpdateParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(keyUpdateParamsSize)
|
|
ob.SetText(keyUpdateParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(keyUpdateParamsIdOff, in.Id)
|
|
ob.SetText(keyUpdateParamsProviderOff, in.Provider)
|
|
ob.SetText(keyUpdateParamsAdapterOff, in.Adapter)
|
|
ob.SetBool(keyUpdateParamsHasSecretKeyOff, in.HasSecretKey)
|
|
ob.SetText(keyUpdateParamsSecretKeyOff, in.SecretKey)
|
|
ob.SetText(keyUpdateParamsBaseURLOff, in.BaseURL)
|
|
ob.SetBool(keyUpdateParamsWithDefaultModelsOff, in.WithDefaultModels)
|
|
ob.SetText(keyUpdateParamsCustomModelsOff, in.CustomModels)
|
|
ob.SetText(keyUpdateParamsConfigOff, in.Config)
|
|
ob.SetText(keyUpdateParamsExtraHeadersOff, in.ExtraHeaders)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
keyTestParamsProjectIdOff = 0
|
|
keyTestParamsProviderOff = 8
|
|
keyTestParamsAdapterOff = 16
|
|
keyTestParamsSecretKeyOff = 24
|
|
keyTestParamsBaseURLOff = 32
|
|
keyTestParamsCustomModelsOff = 40
|
|
keyTestParamsConfigOff = 48
|
|
keyTestParamsExtraHeadersOff = 56
|
|
keyTestParamsSize = 64
|
|
)
|
|
|
|
// KeyTestParams is a zero-copy view into a ZAP-encoded KeyTestParams message.
|
|
type KeyTestParams struct{ o zap.Object }
|
|
|
|
// WrapKeyTestParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapKeyTestParams(b []byte) (KeyTestParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return KeyTestParams{}, err
|
|
}
|
|
return KeyTestParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t KeyTestParams) ProjectId() string { return t.o.Text(keyTestParamsProjectIdOff) }
|
|
func (t KeyTestParams) Provider() string { return t.o.Text(keyTestParamsProviderOff) }
|
|
func (t KeyTestParams) Adapter() string { return t.o.Text(keyTestParamsAdapterOff) }
|
|
func (t KeyTestParams) SecretKey() string { return t.o.Text(keyTestParamsSecretKeyOff) }
|
|
func (t KeyTestParams) BaseURL() string { return t.o.Text(keyTestParamsBaseURLOff) }
|
|
func (t KeyTestParams) CustomModels() string { return t.o.Text(keyTestParamsCustomModelsOff) }
|
|
func (t KeyTestParams) Config() string { return t.o.Text(keyTestParamsConfigOff) }
|
|
func (t KeyTestParams) ExtraHeaders() string { return t.o.Text(keyTestParamsExtraHeadersOff) }
|
|
|
|
// KeyTestParamsInput collects the field values for NewKeyTestParams.
|
|
type KeyTestParamsInput struct {
|
|
ProjectId string
|
|
Provider string
|
|
Adapter string
|
|
SecretKey string
|
|
BaseURL string
|
|
CustomModels string
|
|
Config string
|
|
ExtraHeaders string
|
|
}
|
|
|
|
// NewKeyTestParams builds a ZAP-encoded KeyTestParams message from in and returns the bytes.
|
|
func NewKeyTestParams(in KeyTestParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(keyTestParamsSize)
|
|
ob.SetText(keyTestParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(keyTestParamsProviderOff, in.Provider)
|
|
ob.SetText(keyTestParamsAdapterOff, in.Adapter)
|
|
ob.SetText(keyTestParamsSecretKeyOff, in.SecretKey)
|
|
ob.SetText(keyTestParamsBaseURLOff, in.BaseURL)
|
|
ob.SetText(keyTestParamsCustomModelsOff, in.CustomModels)
|
|
ob.SetText(keyTestParamsConfigOff, in.Config)
|
|
ob.SetText(keyTestParamsExtraHeadersOff, in.ExtraHeaders)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
namedDocParamsProjectIdOff = 0
|
|
namedDocParamsNameOff = 8
|
|
namedDocParamsDescriptionOff = 16
|
|
namedDocParamsBodyOff = 24
|
|
namedDocParamsSize = 32
|
|
)
|
|
|
|
// NamedDocParams is a zero-copy view into a ZAP-encoded NamedDocParams message.
|
|
type NamedDocParams struct{ o zap.Object }
|
|
|
|
// WrapNamedDocParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapNamedDocParams(b []byte) (NamedDocParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return NamedDocParams{}, err
|
|
}
|
|
return NamedDocParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t NamedDocParams) ProjectId() string { return t.o.Text(namedDocParamsProjectIdOff) }
|
|
func (t NamedDocParams) Name() string { return t.o.Text(namedDocParamsNameOff) }
|
|
func (t NamedDocParams) Description() string { return t.o.Text(namedDocParamsDescriptionOff) }
|
|
func (t NamedDocParams) Body() string { return t.o.Text(namedDocParamsBodyOff) }
|
|
|
|
// NamedDocParamsInput collects the field values for NewNamedDocParams.
|
|
type NamedDocParamsInput struct {
|
|
ProjectId string
|
|
Name string
|
|
Description string
|
|
Body string
|
|
}
|
|
|
|
// NewNamedDocParams builds a ZAP-encoded NamedDocParams message from in and returns the bytes.
|
|
func NewNamedDocParams(in NamedDocParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(namedDocParamsSize)
|
|
ob.SetText(namedDocParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(namedDocParamsNameOff, in.Name)
|
|
ob.SetText(namedDocParamsDescriptionOff, in.Description)
|
|
ob.SetText(namedDocParamsBodyOff, in.Body)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
namedDocUpdateProjectIdOff = 0
|
|
namedDocUpdateIdOff = 8
|
|
namedDocUpdateNameOff = 16
|
|
namedDocUpdateDescriptionOff = 24
|
|
namedDocUpdateBodyOff = 32
|
|
namedDocUpdateSize = 40
|
|
)
|
|
|
|
// NamedDocUpdate is a zero-copy view into a ZAP-encoded NamedDocUpdate message.
|
|
type NamedDocUpdate struct{ o zap.Object }
|
|
|
|
// WrapNamedDocUpdate parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapNamedDocUpdate(b []byte) (NamedDocUpdate, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return NamedDocUpdate{}, err
|
|
}
|
|
return NamedDocUpdate{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t NamedDocUpdate) ProjectId() string { return t.o.Text(namedDocUpdateProjectIdOff) }
|
|
func (t NamedDocUpdate) Id() string { return t.o.Text(namedDocUpdateIdOff) }
|
|
func (t NamedDocUpdate) Name() string { return t.o.Text(namedDocUpdateNameOff) }
|
|
func (t NamedDocUpdate) Description() string { return t.o.Text(namedDocUpdateDescriptionOff) }
|
|
func (t NamedDocUpdate) Body() string { return t.o.Text(namedDocUpdateBodyOff) }
|
|
|
|
// NamedDocUpdateInput collects the field values for NewNamedDocUpdate.
|
|
type NamedDocUpdateInput struct {
|
|
ProjectId string
|
|
Id string
|
|
Name string
|
|
Description string
|
|
Body string
|
|
}
|
|
|
|
// NewNamedDocUpdate builds a ZAP-encoded NamedDocUpdate message from in and returns the bytes.
|
|
func NewNamedDocUpdate(in NamedDocUpdateInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(namedDocUpdateSize)
|
|
ob.SetText(namedDocUpdateProjectIdOff, in.ProjectId)
|
|
ob.SetText(namedDocUpdateIdOff, in.Id)
|
|
ob.SetText(namedDocUpdateNameOff, in.Name)
|
|
ob.SetText(namedDocUpdateDescriptionOff, in.Description)
|
|
ob.SetText(namedDocUpdateBodyOff, in.Body)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
modelConfigParamsProjectIdOff = 0
|
|
modelConfigParamsDefaultModelOff = 8
|
|
modelConfigParamsTemperatureOff = 16
|
|
modelConfigParamsMaxTokensOff = 24
|
|
modelConfigParamsSize = 32
|
|
)
|
|
|
|
// ModelConfigParams is a zero-copy view into a ZAP-encoded ModelConfigParams message.
|
|
type ModelConfigParams struct{ o zap.Object }
|
|
|
|
// WrapModelConfigParams parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapModelConfigParams(b []byte) (ModelConfigParams, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ModelConfigParams{}, err
|
|
}
|
|
return ModelConfigParams{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ModelConfigParams) ProjectId() string { return t.o.Text(modelConfigParamsProjectIdOff) }
|
|
func (t ModelConfigParams) DefaultModel() string { return t.o.Text(modelConfigParamsDefaultModelOff) }
|
|
func (t ModelConfigParams) Temperature() float64 { return t.o.Float64(modelConfigParamsTemperatureOff) }
|
|
func (t ModelConfigParams) MaxTokens() int64 { return t.o.Int64(modelConfigParamsMaxTokensOff) }
|
|
|
|
// ModelConfigParamsInput collects the field values for NewModelConfigParams.
|
|
type ModelConfigParamsInput struct {
|
|
ProjectId string
|
|
DefaultModel string
|
|
Temperature float64
|
|
MaxTokens int64
|
|
}
|
|
|
|
// NewModelConfigParams builds a ZAP-encoded ModelConfigParams message from in and returns the bytes.
|
|
func NewModelConfigParams(in ModelConfigParamsInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(modelConfigParamsSize)
|
|
ob.SetText(modelConfigParamsProjectIdOff, in.ProjectId)
|
|
ob.SetText(modelConfigParamsDefaultModelOff, in.DefaultModel)
|
|
ob.SetFloat64(modelConfigParamsTemperatureOff, in.Temperature)
|
|
ob.SetUint64(modelConfigParamsMaxTokensOff, uint64(in.MaxTokens))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
mutationResultSuccessOff = 0
|
|
mutationResultSize = 1
|
|
)
|
|
|
|
// MutationResult is a zero-copy view into a ZAP-encoded MutationResult message.
|
|
type MutationResult struct{ o zap.Object }
|
|
|
|
// WrapMutationResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapMutationResult(b []byte) (MutationResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return MutationResult{}, err
|
|
}
|
|
return MutationResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t MutationResult) Success() bool { return t.o.Bool(mutationResultSuccessOff) }
|
|
|
|
// MutationResultInput collects the field values for NewMutationResult.
|
|
type MutationResultInput struct {
|
|
Success bool
|
|
}
|
|
|
|
// NewMutationResult builds a ZAP-encoded MutationResult message from in and returns the bytes.
|
|
func NewMutationResult(in MutationResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(mutationResultSize)
|
|
ob.SetBool(mutationResultSuccessOff, in.Success)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
llmApiKeyRefIdOff = 0
|
|
llmApiKeyRefProjectIdOff = 8
|
|
llmApiKeyRefProviderOff = 16
|
|
llmApiKeyRefAdapterOff = 24
|
|
llmApiKeyRefDisplaySecretKeyOff = 32
|
|
llmApiKeyRefBaseURLOff = 40
|
|
llmApiKeyRefSize = 48
|
|
)
|
|
|
|
// LlmApiKeyRef is a zero-copy view into a ZAP-encoded LlmApiKeyRef message.
|
|
type LlmApiKeyRef struct{ o zap.Object }
|
|
|
|
// WrapLlmApiKeyRef parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapLlmApiKeyRef(b []byte) (LlmApiKeyRef, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return LlmApiKeyRef{}, err
|
|
}
|
|
return LlmApiKeyRef{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t LlmApiKeyRef) Id() string { return t.o.Text(llmApiKeyRefIdOff) }
|
|
func (t LlmApiKeyRef) ProjectId() string { return t.o.Text(llmApiKeyRefProjectIdOff) }
|
|
func (t LlmApiKeyRef) Provider() string { return t.o.Text(llmApiKeyRefProviderOff) }
|
|
func (t LlmApiKeyRef) Adapter() string { return t.o.Text(llmApiKeyRefAdapterOff) }
|
|
func (t LlmApiKeyRef) DisplaySecretKey() string { return t.o.Text(llmApiKeyRefDisplaySecretKeyOff) }
|
|
func (t LlmApiKeyRef) BaseURL() string { return t.o.Text(llmApiKeyRefBaseURLOff) }
|
|
|
|
// LlmApiKeyRefInput collects the field values for NewLlmApiKeyRef.
|
|
type LlmApiKeyRefInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Provider string
|
|
Adapter string
|
|
DisplaySecretKey string
|
|
BaseURL string
|
|
}
|
|
|
|
// NewLlmApiKeyRef builds a ZAP-encoded LlmApiKeyRef message from in and returns the bytes.
|
|
func NewLlmApiKeyRef(in LlmApiKeyRefInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(llmApiKeyRefSize)
|
|
ob.SetText(llmApiKeyRefIdOff, in.Id)
|
|
ob.SetText(llmApiKeyRefProjectIdOff, in.ProjectId)
|
|
ob.SetText(llmApiKeyRefProviderOff, in.Provider)
|
|
ob.SetText(llmApiKeyRefAdapterOff, in.Adapter)
|
|
ob.SetText(llmApiKeyRefDisplaySecretKeyOff, in.DisplaySecretKey)
|
|
ob.SetText(llmApiKeyRefBaseURLOff, in.BaseURL)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
llmApiKeyViewIdOff = 0
|
|
llmApiKeyViewProjectIdOff = 8
|
|
llmApiKeyViewProviderOff = 16
|
|
llmApiKeyViewAdapterOff = 24
|
|
llmApiKeyViewDisplaySecretKeyOff = 32
|
|
llmApiKeyViewBaseURLOff = 40
|
|
llmApiKeyViewWithDefaultModelsOff = 48
|
|
llmApiKeyViewCustomModelsOff = 52
|
|
llmApiKeyViewExtraHeaderKeysOff = 60
|
|
llmApiKeyViewAuthMethodOff = 68
|
|
llmApiKeyViewCreatedAtOff = 76
|
|
llmApiKeyViewUpdatedAtOff = 84
|
|
llmApiKeyViewSize = 92
|
|
)
|
|
|
|
// LlmApiKeyView is a zero-copy view into a ZAP-encoded LlmApiKeyView message.
|
|
type LlmApiKeyView struct{ o zap.Object }
|
|
|
|
// WrapLlmApiKeyView parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapLlmApiKeyView(b []byte) (LlmApiKeyView, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return LlmApiKeyView{}, err
|
|
}
|
|
return LlmApiKeyView{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t LlmApiKeyView) Id() string { return t.o.Text(llmApiKeyViewIdOff) }
|
|
func (t LlmApiKeyView) ProjectId() string { return t.o.Text(llmApiKeyViewProjectIdOff) }
|
|
func (t LlmApiKeyView) Provider() string { return t.o.Text(llmApiKeyViewProviderOff) }
|
|
func (t LlmApiKeyView) Adapter() string { return t.o.Text(llmApiKeyViewAdapterOff) }
|
|
func (t LlmApiKeyView) DisplaySecretKey() string { return t.o.Text(llmApiKeyViewDisplaySecretKeyOff) }
|
|
func (t LlmApiKeyView) BaseURL() string { return t.o.Text(llmApiKeyViewBaseURLOff) }
|
|
func (t LlmApiKeyView) WithDefaultModels() bool { return t.o.Bool(llmApiKeyViewWithDefaultModelsOff) }
|
|
func (t LlmApiKeyView) CustomModels() zap.List { return t.o.List(llmApiKeyViewCustomModelsOff) }
|
|
func (t LlmApiKeyView) ExtraHeaderKeys() zap.List { return t.o.List(llmApiKeyViewExtraHeaderKeysOff) }
|
|
func (t LlmApiKeyView) AuthMethod() string { return t.o.Text(llmApiKeyViewAuthMethodOff) }
|
|
func (t LlmApiKeyView) CreatedAt() string { return t.o.Text(llmApiKeyViewCreatedAtOff) }
|
|
func (t LlmApiKeyView) UpdatedAt() string { return t.o.Text(llmApiKeyViewUpdatedAtOff) }
|
|
|
|
// LlmApiKeyViewInput collects the field values for NewLlmApiKeyView.
|
|
type LlmApiKeyViewInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Provider string
|
|
Adapter string
|
|
DisplaySecretKey string
|
|
BaseURL string
|
|
WithDefaultModels bool
|
|
CustomModels [][]byte
|
|
ExtraHeaderKeys [][]byte
|
|
AuthMethod string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
// NewLlmApiKeyView builds a ZAP-encoded LlmApiKeyView message from in and returns the bytes.
|
|
func NewLlmApiKeyView(in LlmApiKeyViewInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(llmApiKeyViewSize)
|
|
ob.SetText(llmApiKeyViewIdOff, in.Id)
|
|
ob.SetText(llmApiKeyViewProjectIdOff, in.ProjectId)
|
|
ob.SetText(llmApiKeyViewProviderOff, in.Provider)
|
|
ob.SetText(llmApiKeyViewAdapterOff, in.Adapter)
|
|
ob.SetText(llmApiKeyViewDisplaySecretKeyOff, in.DisplaySecretKey)
|
|
ob.SetText(llmApiKeyViewBaseURLOff, in.BaseURL)
|
|
ob.SetBool(llmApiKeyViewWithDefaultModelsOff, in.WithDefaultModels)
|
|
customModelsLB := b.StartList(0)
|
|
for _, elem := range in.CustomModels {
|
|
customModelsLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(llmApiKeyViewCustomModelsOff, customModelsLB.FinishOffset(), len(in.CustomModels))
|
|
extraHeaderKeysLB := b.StartList(0)
|
|
for _, elem := range in.ExtraHeaderKeys {
|
|
extraHeaderKeysLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(llmApiKeyViewExtraHeaderKeysOff, extraHeaderKeysLB.FinishOffset(), len(in.ExtraHeaderKeys))
|
|
ob.SetText(llmApiKeyViewAuthMethodOff, in.AuthMethod)
|
|
ob.SetText(llmApiKeyViewCreatedAtOff, in.CreatedAt)
|
|
ob.SetText(llmApiKeyViewUpdatedAtOff, in.UpdatedAt)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
llmApiKeyListDataOff = 0
|
|
llmApiKeyListTotalCountOff = 8
|
|
llmApiKeyListSize = 16
|
|
)
|
|
|
|
// LlmApiKeyList is a zero-copy view into a ZAP-encoded LlmApiKeyList message.
|
|
type LlmApiKeyList struct{ o zap.Object }
|
|
|
|
// WrapLlmApiKeyList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapLlmApiKeyList(b []byte) (LlmApiKeyList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return LlmApiKeyList{}, err
|
|
}
|
|
return LlmApiKeyList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t LlmApiKeyList) Data() zap.List { return t.o.List(llmApiKeyListDataOff) }
|
|
func (t LlmApiKeyList) TotalCount() int64 { return t.o.Int64(llmApiKeyListTotalCountOff) }
|
|
|
|
// LlmApiKeyListInput collects the field values for NewLlmApiKeyList.
|
|
type LlmApiKeyListInput struct {
|
|
Data [][]byte
|
|
TotalCount int64
|
|
}
|
|
|
|
// NewLlmApiKeyList builds a ZAP-encoded LlmApiKeyList message from in and returns the bytes.
|
|
func NewLlmApiKeyList(in LlmApiKeyListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(llmApiKeyListSize)
|
|
dataLB := b.StartList(0)
|
|
for _, elem := range in.Data {
|
|
dataLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(llmApiKeyListDataOff, dataLB.FinishOffset(), len(in.Data))
|
|
ob.SetUint64(llmApiKeyListTotalCountOff, uint64(in.TotalCount))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
testResultSuccessOff = 0
|
|
testResultErrorOff = 4
|
|
testResultSize = 12
|
|
)
|
|
|
|
// TestResult is a zero-copy view into a ZAP-encoded TestResult message.
|
|
type TestResult struct{ o zap.Object }
|
|
|
|
// WrapTestResult parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapTestResult(b []byte) (TestResult, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return TestResult{}, err
|
|
}
|
|
return TestResult{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t TestResult) Success() bool { return t.o.Bool(testResultSuccessOff) }
|
|
func (t TestResult) Error() string { return t.o.Text(testResultErrorOff) }
|
|
|
|
// TestResultInput collects the field values for NewTestResult.
|
|
type TestResultInput struct {
|
|
Success bool
|
|
Error string
|
|
}
|
|
|
|
// NewTestResult builds a ZAP-encoded TestResult message from in and returns the bytes.
|
|
func NewTestResult(in TestResultInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(testResultSize)
|
|
ob.SetBool(testResultSuccessOff, in.Success)
|
|
ob.SetText(testResultErrorOff, in.Error)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
llmDocRefIdOff = 0
|
|
llmDocRefProjectIdOff = 8
|
|
llmDocRefNameOff = 16
|
|
llmDocRefDescriptionOff = 24
|
|
llmDocRefBodyOff = 32
|
|
llmDocRefCreatedAtOff = 40
|
|
llmDocRefUpdatedAtOff = 48
|
|
llmDocRefSize = 56
|
|
)
|
|
|
|
// LlmDocRef is a zero-copy view into a ZAP-encoded LlmDocRef message.
|
|
type LlmDocRef struct{ o zap.Object }
|
|
|
|
// WrapLlmDocRef parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapLlmDocRef(b []byte) (LlmDocRef, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return LlmDocRef{}, err
|
|
}
|
|
return LlmDocRef{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t LlmDocRef) Id() string { return t.o.Text(llmDocRefIdOff) }
|
|
func (t LlmDocRef) ProjectId() string { return t.o.Text(llmDocRefProjectIdOff) }
|
|
func (t LlmDocRef) Name() string { return t.o.Text(llmDocRefNameOff) }
|
|
func (t LlmDocRef) Description() string { return t.o.Text(llmDocRefDescriptionOff) }
|
|
func (t LlmDocRef) Body() string { return t.o.Text(llmDocRefBodyOff) }
|
|
func (t LlmDocRef) CreatedAt() string { return t.o.Text(llmDocRefCreatedAtOff) }
|
|
func (t LlmDocRef) UpdatedAt() string { return t.o.Text(llmDocRefUpdatedAtOff) }
|
|
|
|
// LlmDocRefInput collects the field values for NewLlmDocRef.
|
|
type LlmDocRefInput struct {
|
|
Id string
|
|
ProjectId string
|
|
Name string
|
|
Description string
|
|
Body string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
// NewLlmDocRef builds a ZAP-encoded LlmDocRef message from in and returns the bytes.
|
|
func NewLlmDocRef(in LlmDocRefInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(llmDocRefSize)
|
|
ob.SetText(llmDocRefIdOff, in.Id)
|
|
ob.SetText(llmDocRefProjectIdOff, in.ProjectId)
|
|
ob.SetText(llmDocRefNameOff, in.Name)
|
|
ob.SetText(llmDocRefDescriptionOff, in.Description)
|
|
ob.SetText(llmDocRefBodyOff, in.Body)
|
|
ob.SetText(llmDocRefCreatedAtOff, in.CreatedAt)
|
|
ob.SetText(llmDocRefUpdatedAtOff, in.UpdatedAt)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
llmDocListDataOff = 0
|
|
llmDocListSize = 8
|
|
)
|
|
|
|
// LlmDocList is a zero-copy view into a ZAP-encoded LlmDocList message.
|
|
type LlmDocList struct{ o zap.Object }
|
|
|
|
// WrapLlmDocList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapLlmDocList(b []byte) (LlmDocList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return LlmDocList{}, err
|
|
}
|
|
return LlmDocList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t LlmDocList) Data() zap.List { return t.o.List(llmDocListDataOff) }
|
|
|
|
// LlmDocListInput collects the field values for NewLlmDocList.
|
|
type LlmDocListInput struct {
|
|
Data [][]byte
|
|
}
|
|
|
|
// NewLlmDocList builds a ZAP-encoded LlmDocList message from in and returns the bytes.
|
|
func NewLlmDocList(in LlmDocListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(llmDocListSize)
|
|
dataLB := b.StartList(0)
|
|
for _, elem := range in.Data {
|
|
dataLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(llmDocListDataOff, dataLB.FinishOffset(), len(in.Data))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
cloudModelViewIdOff = 0
|
|
cloudModelViewObjectOff = 8
|
|
cloudModelViewCreatedOff = 16
|
|
cloudModelViewOwnedByOff = 24
|
|
cloudModelViewPremiumOff = 32
|
|
cloudModelViewSize = 33
|
|
)
|
|
|
|
// CloudModelView is a zero-copy view into a ZAP-encoded CloudModelView message.
|
|
type CloudModelView struct{ o zap.Object }
|
|
|
|
// WrapCloudModelView parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapCloudModelView(b []byte) (CloudModelView, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return CloudModelView{}, err
|
|
}
|
|
return CloudModelView{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t CloudModelView) Id() string { return t.o.Text(cloudModelViewIdOff) }
|
|
func (t CloudModelView) Object() string { return t.o.Text(cloudModelViewObjectOff) }
|
|
func (t CloudModelView) Created() int64 { return t.o.Int64(cloudModelViewCreatedOff) }
|
|
func (t CloudModelView) OwnedBy() string { return t.o.Text(cloudModelViewOwnedByOff) }
|
|
func (t CloudModelView) Premium() bool { return t.o.Bool(cloudModelViewPremiumOff) }
|
|
|
|
// CloudModelViewInput collects the field values for NewCloudModelView.
|
|
type CloudModelViewInput struct {
|
|
Id string
|
|
Object string
|
|
Created int64
|
|
OwnedBy string
|
|
Premium bool
|
|
}
|
|
|
|
// NewCloudModelView builds a ZAP-encoded CloudModelView message from in and returns the bytes.
|
|
func NewCloudModelView(in CloudModelViewInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(cloudModelViewSize)
|
|
ob.SetText(cloudModelViewIdOff, in.Id)
|
|
ob.SetText(cloudModelViewObjectOff, in.Object)
|
|
ob.SetUint64(cloudModelViewCreatedOff, uint64(in.Created))
|
|
ob.SetText(cloudModelViewOwnedByOff, in.OwnedBy)
|
|
ob.SetBool(cloudModelViewPremiumOff, in.Premium)
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
cloudModelListObjectOff = 0
|
|
cloudModelListDataOff = 8
|
|
cloudModelListSize = 16
|
|
)
|
|
|
|
// CloudModelList is a zero-copy view into a ZAP-encoded CloudModelList message.
|
|
type CloudModelList struct{ o zap.Object }
|
|
|
|
// WrapCloudModelList parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapCloudModelList(b []byte) (CloudModelList, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return CloudModelList{}, err
|
|
}
|
|
return CloudModelList{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t CloudModelList) Object() string { return t.o.Text(cloudModelListObjectOff) }
|
|
func (t CloudModelList) Data() zap.List { return t.o.List(cloudModelListDataOff) }
|
|
|
|
// CloudModelListInput collects the field values for NewCloudModelList.
|
|
type CloudModelListInput struct {
|
|
Object string
|
|
Data [][]byte
|
|
}
|
|
|
|
// NewCloudModelList builds a ZAP-encoded CloudModelList message from in and returns the bytes.
|
|
func NewCloudModelList(in CloudModelListInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(cloudModelListSize)
|
|
ob.SetText(cloudModelListObjectOff, in.Object)
|
|
dataLB := b.StartList(0)
|
|
for _, elem := range in.Data {
|
|
dataLB.AddObjectBytes(elem)
|
|
}
|
|
ob.SetList(cloudModelListDataOff, dataLB.FinishOffset(), len(in.Data))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|
|
|
|
const (
|
|
modelConfigProjectIdOff = 0
|
|
modelConfigDefaultModelOff = 8
|
|
modelConfigTemperatureOff = 16
|
|
modelConfigMaxTokensOff = 24
|
|
modelConfigSize = 32
|
|
)
|
|
|
|
// ModelConfig is a zero-copy view into a ZAP-encoded ModelConfig message.
|
|
type ModelConfig struct{ o zap.Object }
|
|
|
|
// WrapModelConfig parses b and returns a typed view. Returns an error if the
|
|
// wire-level checks (magic, version, size) fail.
|
|
func WrapModelConfig(b []byte) (ModelConfig, error) {
|
|
m, err := zap.Parse(b)
|
|
if err != nil {
|
|
return ModelConfig{}, err
|
|
}
|
|
return ModelConfig{o: m.Root()}, nil
|
|
}
|
|
|
|
func (t ModelConfig) ProjectId() string { return t.o.Text(modelConfigProjectIdOff) }
|
|
func (t ModelConfig) DefaultModel() string { return t.o.Text(modelConfigDefaultModelOff) }
|
|
func (t ModelConfig) Temperature() float64 { return t.o.Float64(modelConfigTemperatureOff) }
|
|
func (t ModelConfig) MaxTokens() int64 { return t.o.Int64(modelConfigMaxTokensOff) }
|
|
|
|
// ModelConfigInput collects the field values for NewModelConfig.
|
|
type ModelConfigInput struct {
|
|
ProjectId string
|
|
DefaultModel string
|
|
Temperature float64
|
|
MaxTokens int64
|
|
}
|
|
|
|
// NewModelConfig builds a ZAP-encoded ModelConfig message from in and returns the bytes.
|
|
func NewModelConfig(in ModelConfigInput) []byte {
|
|
b := zap.NewBuilder(256)
|
|
ob := b.StartObject(modelConfigSize)
|
|
ob.SetText(modelConfigProjectIdOff, in.ProjectId)
|
|
ob.SetText(modelConfigDefaultModelOff, in.DefaultModel)
|
|
ob.SetFloat64(modelConfigTemperatureOff, in.Temperature)
|
|
ob.SetUint64(modelConfigMaxTokensOff, uint64(in.MaxTokens))
|
|
ob.FinishAsRoot()
|
|
return b.Finish()
|
|
}
|