memory

package
v0.0.0-...-903a156 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAgent         = "Agent"
	TypeMessage       = "Message"
	TypeModel         = "Model"
	TypeModelProvider = "ModelProvider"
	TypeTask          = "Task"
)

Variables

View Source
var ErrTxStarted = errors.New("memory: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

func SanitizeError

func SanitizeError(err error) error

func ServeEntviz

func ServeEntviz() http.Handler

func Transaction

func Transaction[T any](ctx context.Context, client *Client, fn func(tx *Client) (*T, error)) (*T, error)

Types

type Agent

type Agent struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Instructions holds the value of the "instructions" field.
	Instructions string `json:"instructions,omitempty"`
	// Builtin holds the value of the "builtin" field.
	Builtin bool `json:"builtin,omitempty"`
	// ModelID holds the value of the "model_id" field.
	ModelID uuid.UUID `json:"model_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AgentQuery when eager-loading is set.
	Edges AgentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Agent is the model entity for the Agent schema.

func (*Agent) QueryMessages

func (a *Agent) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Agent entity.

func (*Agent) QueryModel

func (a *Agent) QueryModel() *ModelQuery

QueryModel queries the "model" edge of the Agent entity.

func (*Agent) QueryTasks

func (a *Agent) QueryTasks() *TaskQuery

QueryTasks queries the "tasks" edge of the Agent entity.

func (*Agent) String

func (a *Agent) String() string

String implements the fmt.Stringer.

func (*Agent) Unwrap

func (a *Agent) Unwrap() *Agent

Unwrap unwraps the Agent entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Agent) Update

func (a *Agent) Update() *AgentUpdateOne

Update returns a builder for updating this Agent. Note that you need to call Agent.Unwrap() before calling this method if this Agent was returned from a transaction, and the transaction was committed or rolled back.

func (*Agent) Value

func (a *Agent) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Agent. This includes values selected through modifiers, order, etc.

type AgentClient

type AgentClient struct {
	// contains filtered or unexported fields
}

AgentClient is a client for the Agent schema.

func NewAgentClient

func NewAgentClient(c config) *AgentClient

NewAgentClient returns a client for the Agent from the given config.

func (*AgentClient) Create

func (c *AgentClient) Create() *AgentCreate

Create returns a builder for creating a Agent entity.

func (*AgentClient) CreateBulk

func (c *AgentClient) CreateBulk(builders ...*AgentCreate) *AgentCreateBulk

CreateBulk returns a builder for creating a bulk of Agent entities.

func (*AgentClient) Delete

func (c *AgentClient) Delete() *AgentDelete

Delete returns a delete builder for Agent.

func (*AgentClient) DeleteOne

func (c *AgentClient) DeleteOne(a *Agent) *AgentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AgentClient) DeleteOneID

func (c *AgentClient) DeleteOneID(id uuid.UUID) *AgentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*AgentClient) Get

func (c *AgentClient) Get(ctx context.Context, id uuid.UUID) (*Agent, error)

Get returns a Agent entity by its id.

func (*AgentClient) GetX

func (c *AgentClient) GetX(ctx context.Context, id uuid.UUID) *Agent

GetX is like Get, but panics if an error occurs.

func (*AgentClient) Hooks

func (c *AgentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*AgentClient) Intercept

func (c *AgentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `agent.Intercept(f(g(h())))`.

func (*AgentClient) Interceptors

func (c *AgentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AgentClient) MapCreateBulk

func (c *AgentClient) MapCreateBulk(slice any, setFunc func(*AgentCreate, int)) *AgentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AgentClient) Query

func (c *AgentClient) Query() *AgentQuery

Query returns a query builder for Agent.

func (*AgentClient) QueryMessages

func (c *AgentClient) QueryMessages(a *Agent) *MessageQuery

QueryMessages queries the messages edge of a Agent.

func (*AgentClient) QueryModel

func (c *AgentClient) QueryModel(a *Agent) *ModelQuery

QueryModel queries the model edge of a Agent.

func (*AgentClient) QueryTasks

func (c *AgentClient) QueryTasks(a *Agent) *TaskQuery

QueryTasks queries the tasks edge of a Agent.

func (*AgentClient) Update

func (c *AgentClient) Update() *AgentUpdate

Update returns an update builder for Agent.

func (*AgentClient) UpdateOne

func (c *AgentClient) UpdateOne(a *Agent) *AgentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AgentClient) UpdateOneID

func (c *AgentClient) UpdateOneID(id uuid.UUID) *AgentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgentClient) Use

func (c *AgentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `agent.Hooks(f(g(h())))`.

type AgentCreate

type AgentCreate struct {
	// contains filtered or unexported fields
}

AgentCreate is the builder for creating a Agent entity.

func (*AgentCreate) AddMessageIDs

func (ac *AgentCreate) AddMessageIDs(ids ...uuid.UUID) *AgentCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*AgentCreate) AddMessages

func (ac *AgentCreate) AddMessages(m ...*Message) *AgentCreate

AddMessages adds the "messages" edges to the Message entity.

func (*AgentCreate) AddTaskIDs

func (ac *AgentCreate) AddTaskIDs(ids ...uuid.UUID) *AgentCreate

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*AgentCreate) AddTasks

func (ac *AgentCreate) AddTasks(t ...*Task) *AgentCreate

AddTasks adds the "tasks" edges to the Task entity.

func (*AgentCreate) Exec

func (ac *AgentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentCreate) ExecX

func (ac *AgentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgentCreate) Mutation

func (ac *AgentCreate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentCreate) Save

func (ac *AgentCreate) Save(ctx context.Context) (*Agent, error)

Save creates the Agent in the database.

func (*AgentCreate) SaveX

func (ac *AgentCreate) SaveX(ctx context.Context) *Agent

SaveX calls Save and panics if Save returns an error.

func (*AgentCreate) SetBuiltin

func (ac *AgentCreate) SetBuiltin(b bool) *AgentCreate

SetBuiltin sets the "builtin" field.

func (*AgentCreate) SetCreateTime

func (ac *AgentCreate) SetCreateTime(t time.Time) *AgentCreate

SetCreateTime sets the "create_time" field.

func (*AgentCreate) SetDescription

func (ac *AgentCreate) SetDescription(s string) *AgentCreate

SetDescription sets the "description" field.

func (*AgentCreate) SetID

func (ac *AgentCreate) SetID(u uuid.UUID) *AgentCreate

SetID sets the "id" field.

func (*AgentCreate) SetInstructions

func (ac *AgentCreate) SetInstructions(s string) *AgentCreate

SetInstructions sets the "instructions" field.

func (*AgentCreate) SetModel

func (ac *AgentCreate) SetModel(m *Model) *AgentCreate

SetModel sets the "model" edge to the Model entity.

func (*AgentCreate) SetModelID

func (ac *AgentCreate) SetModelID(u uuid.UUID) *AgentCreate

SetModelID sets the "model_id" field.

func (*AgentCreate) SetName

func (ac *AgentCreate) SetName(s string) *AgentCreate

SetName sets the "name" field.

func (*AgentCreate) SetNillableBuiltin

func (ac *AgentCreate) SetNillableBuiltin(b *bool) *AgentCreate

SetNillableBuiltin sets the "builtin" field if the given value is not nil.

func (*AgentCreate) SetNillableCreateTime

func (ac *AgentCreate) SetNillableCreateTime(t *time.Time) *AgentCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*AgentCreate) SetNillableDescription

func (ac *AgentCreate) SetNillableDescription(s *string) *AgentCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AgentCreate) SetNillableID

func (ac *AgentCreate) SetNillableID(u *uuid.UUID) *AgentCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AgentCreate) SetNillableModelID

func (ac *AgentCreate) SetNillableModelID(u *uuid.UUID) *AgentCreate

SetNillableModelID sets the "model_id" field if the given value is not nil.

func (*AgentCreate) SetNillableUpdateTime

func (ac *AgentCreate) SetNillableUpdateTime(t *time.Time) *AgentCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*AgentCreate) SetUpdateTime

func (ac *AgentCreate) SetUpdateTime(t time.Time) *AgentCreate

SetUpdateTime sets the "update_time" field.

type AgentCreateBulk

type AgentCreateBulk struct {
	// contains filtered or unexported fields
}

AgentCreateBulk is the builder for creating many Agent entities in bulk.

func (*AgentCreateBulk) Exec

func (acb *AgentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentCreateBulk) ExecX

func (acb *AgentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgentCreateBulk) Save

func (acb *AgentCreateBulk) Save(ctx context.Context) ([]*Agent, error)

Save creates the Agent entities in the database.

func (*AgentCreateBulk) SaveX

func (acb *AgentCreateBulk) SaveX(ctx context.Context) []*Agent

SaveX is like Save, but panics if an error occurs.

type AgentDelete

type AgentDelete struct {
	// contains filtered or unexported fields
}

AgentDelete is the builder for deleting a Agent entity.

func (*AgentDelete) Exec

func (ad *AgentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*AgentDelete) ExecX

func (ad *AgentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*AgentDelete) Where

func (ad *AgentDelete) Where(ps ...predicate.Agent) *AgentDelete

Where appends a list predicates to the AgentDelete builder.

type AgentDeleteOne

type AgentDeleteOne struct {
	// contains filtered or unexported fields
}

AgentDeleteOne is the builder for deleting a single Agent entity.

func (*AgentDeleteOne) Exec

func (ado *AgentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AgentDeleteOne) ExecX

func (ado *AgentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgentDeleteOne) Where

func (ado *AgentDeleteOne) Where(ps ...predicate.Agent) *AgentDeleteOne

Where appends a list predicates to the AgentDelete builder.

type AgentEdges

type AgentEdges struct {
	// Model holds the value of the model edge.
	Model *Model `json:"model,omitempty"`
	// Tasks holds the value of the tasks edge.
	Tasks []*Task `json:"tasks,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

AgentEdges holds the relations/edges for other nodes in the graph.

func (AgentEdges) MessagesOrErr

func (e AgentEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

func (AgentEdges) ModelOrErr

func (e AgentEdges) ModelOrErr() (*Model, error)

ModelOrErr returns the Model value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (AgentEdges) TasksOrErr

func (e AgentEdges) TasksOrErr() ([]*Task, error)

TasksOrErr returns the Tasks value or an error if the edge was not loaded in eager-loading.

type AgentGroupBy

type AgentGroupBy struct {
	// contains filtered or unexported fields
}

AgentGroupBy is the group-by builder for Agent entities.

func (*AgentGroupBy) Aggregate

func (agb *AgentGroupBy) Aggregate(fns ...AggregateFunc) *AgentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*AgentGroupBy) Bool

func (s *AgentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) BoolX

func (s *AgentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AgentGroupBy) Bools

func (s *AgentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) BoolsX

func (s *AgentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AgentGroupBy) Float64

func (s *AgentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) Float64X

func (s *AgentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AgentGroupBy) Float64s

func (s *AgentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) Float64sX

func (s *AgentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AgentGroupBy) Int

func (s *AgentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) IntX

func (s *AgentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AgentGroupBy) Ints

func (s *AgentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) IntsX

func (s *AgentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AgentGroupBy) Scan

func (agb *AgentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*AgentGroupBy) ScanX

func (s *AgentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*AgentGroupBy) String

func (s *AgentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) StringX

func (s *AgentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AgentGroupBy) Strings

func (s *AgentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AgentGroupBy) StringsX

func (s *AgentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AgentMutation

type AgentMutation struct {
	// contains filtered or unexported fields
}

AgentMutation represents an operation that mutates the Agent nodes in the graph.

func (*AgentMutation) AddField

func (m *AgentMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AgentMutation) AddMessageIDs

func (m *AgentMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*AgentMutation) AddTaskIDs

func (m *AgentMutation) AddTaskIDs(ids ...uuid.UUID)

AddTaskIDs adds the "tasks" edge to the Task entity by ids.

func (*AgentMutation) AddedEdges

func (m *AgentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*AgentMutation) AddedField

func (m *AgentMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AgentMutation) AddedFields

func (m *AgentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*AgentMutation) AddedIDs

func (m *AgentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*AgentMutation) Builtin

func (m *AgentMutation) Builtin() (r bool, exists bool)

Builtin returns the value of the "builtin" field in the mutation.

func (*AgentMutation) ClearDescription

func (m *AgentMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*AgentMutation) ClearEdge

func (m *AgentMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*AgentMutation) ClearField

func (m *AgentMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*AgentMutation) ClearMessages

func (m *AgentMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*AgentMutation) ClearModel

func (m *AgentMutation) ClearModel()

ClearModel clears the "model" edge to the Model entity.

func (*AgentMutation) ClearModelID

func (m *AgentMutation) ClearModelID()

ClearModelID clears the value of the "model_id" field.

func (*AgentMutation) ClearTasks

func (m *AgentMutation) ClearTasks()

ClearTasks clears the "tasks" edge to the Task entity.

func (*AgentMutation) ClearedEdges

func (m *AgentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*AgentMutation) ClearedFields

func (m *AgentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (AgentMutation) Client

func (m AgentMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*AgentMutation) CreateTime

func (m *AgentMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*AgentMutation) Description

func (m *AgentMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*AgentMutation) DescriptionCleared

func (m *AgentMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*AgentMutation) EdgeCleared

func (m *AgentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*AgentMutation) Field

func (m *AgentMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AgentMutation) FieldCleared

func (m *AgentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*AgentMutation) Fields

func (m *AgentMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*AgentMutation) ID

func (m *AgentMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*AgentMutation) IDs

func (m *AgentMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*AgentMutation) Instructions

func (m *AgentMutation) Instructions() (r string, exists bool)

Instructions returns the value of the "instructions" field in the mutation.

func (*AgentMutation) MessagesCleared

func (m *AgentMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*AgentMutation) MessagesIDs

func (m *AgentMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*AgentMutation) ModelCleared

func (m *AgentMutation) ModelCleared() bool

ModelCleared reports if the "model" edge to the Model entity was cleared.

func (*AgentMutation) ModelID

func (m *AgentMutation) ModelID() (r uuid.UUID, exists bool)

ModelID returns the value of the "model_id" field in the mutation.

func (*AgentMutation) ModelIDCleared

func (m *AgentMutation) ModelIDCleared() bool

ModelIDCleared returns if the "model_id" field was cleared in this mutation.

func (*AgentMutation) ModelIDs

func (m *AgentMutation) ModelIDs() (ids []uuid.UUID)

ModelIDs returns the "model" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ModelID instead. It exists only for internal usage by the builders.

func (*AgentMutation) Name

func (m *AgentMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*AgentMutation) OldBuiltin

func (m *AgentMutation) OldBuiltin(ctx context.Context) (v bool, err error)

OldBuiltin returns the old "builtin" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) OldCreateTime

func (m *AgentMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) OldDescription

func (m *AgentMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) OldField

func (m *AgentMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*AgentMutation) OldInstructions

func (m *AgentMutation) OldInstructions(ctx context.Context) (v string, err error)

OldInstructions returns the old "instructions" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) OldModelID

func (m *AgentMutation) OldModelID(ctx context.Context) (v uuid.UUID, err error)

OldModelID returns the old "model_id" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) OldName

func (m *AgentMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) OldUpdateTime

func (m *AgentMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Agent entity. If the Agent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AgentMutation) Op

func (m *AgentMutation) Op() Op

Op returns the operation name.

func (*AgentMutation) RemoveMessageIDs

func (m *AgentMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*AgentMutation) RemoveTaskIDs

func (m *AgentMutation) RemoveTaskIDs(ids ...uuid.UUID)

RemoveTaskIDs removes the "tasks" edge to the Task entity by IDs.

func (*AgentMutation) RemovedEdges

func (m *AgentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*AgentMutation) RemovedIDs

func (m *AgentMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*AgentMutation) RemovedMessagesIDs

func (m *AgentMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*AgentMutation) RemovedTasksIDs

func (m *AgentMutation) RemovedTasksIDs() (ids []uuid.UUID)

RemovedTasks returns the removed IDs of the "tasks" edge to the Task entity.

func (*AgentMutation) ResetBuiltin

func (m *AgentMutation) ResetBuiltin()

ResetBuiltin resets all changes to the "builtin" field.

func (*AgentMutation) ResetCreateTime

func (m *AgentMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*AgentMutation) ResetDescription

func (m *AgentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AgentMutation) ResetEdge

func (m *AgentMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*AgentMutation) ResetField

func (m *AgentMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*AgentMutation) ResetInstructions

func (m *AgentMutation) ResetInstructions()

ResetInstructions resets all changes to the "instructions" field.

func (*AgentMutation) ResetMessages

func (m *AgentMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*AgentMutation) ResetModel

func (m *AgentMutation) ResetModel()

ResetModel resets all changes to the "model" edge.

func (*AgentMutation) ResetModelID

func (m *AgentMutation) ResetModelID()

ResetModelID resets all changes to the "model_id" field.

func (*AgentMutation) ResetName

func (m *AgentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AgentMutation) ResetTasks

func (m *AgentMutation) ResetTasks()

ResetTasks resets all changes to the "tasks" edge.

func (*AgentMutation) ResetUpdateTime

func (m *AgentMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*AgentMutation) SetBuiltin

func (m *AgentMutation) SetBuiltin(b bool)

SetBuiltin sets the "builtin" field.

func (*AgentMutation) SetCreateTime

func (m *AgentMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*AgentMutation) SetDescription

func (m *AgentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AgentMutation) SetField

func (m *AgentMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AgentMutation) SetID

func (m *AgentMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Agent entities.

func (*AgentMutation) SetInstructions

func (m *AgentMutation) SetInstructions(s string)

SetInstructions sets the "instructions" field.

func (*AgentMutation) SetModelID

func (m *AgentMutation) SetModelID(u uuid.UUID)

SetModelID sets the "model_id" field.

func (*AgentMutation) SetName

func (m *AgentMutation) SetName(s string)

SetName sets the "name" field.

func (*AgentMutation) SetOp

func (m *AgentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgentMutation) SetUpdateTime

func (m *AgentMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*AgentMutation) TasksCleared

func (m *AgentMutation) TasksCleared() bool

TasksCleared reports if the "tasks" edge to the Task entity was cleared.

func (*AgentMutation) TasksIDs

func (m *AgentMutation) TasksIDs() (ids []uuid.UUID)

TasksIDs returns the "tasks" edge IDs in the mutation.

func (AgentMutation) Tx

func (m AgentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*AgentMutation) Type

func (m *AgentMutation) Type() string

Type returns the node type of this mutation (Agent).

func (*AgentMutation) UpdateTime

func (m *AgentMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*AgentMutation) Where

func (m *AgentMutation) Where(ps ...predicate.Agent)

Where appends a list predicates to the AgentMutation builder.

func (*AgentMutation) WhereP

func (m *AgentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AgentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type AgentQuery

type AgentQuery struct {
	// contains filtered or unexported fields
}

AgentQuery is the builder for querying Agent entities.

func (*AgentQuery) Aggregate

func (aq *AgentQuery) Aggregate(fns ...AggregateFunc) *AgentSelect

Aggregate returns a AgentSelect configured with the given aggregations.

func (*AgentQuery) All

func (aq *AgentQuery) All(ctx context.Context) ([]*Agent, error)

All executes the query and returns a list of Agents.

func (*AgentQuery) AllX

func (aq *AgentQuery) AllX(ctx context.Context) []*Agent

AllX is like All, but panics if an error occurs.

func (*AgentQuery) Clone

func (aq *AgentQuery) Clone() *AgentQuery

Clone returns a duplicate of the AgentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*AgentQuery) Count

func (aq *AgentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AgentQuery) CountX

func (aq *AgentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*AgentQuery) Exist

func (aq *AgentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*AgentQuery) ExistX

func (aq *AgentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*AgentQuery) First

func (aq *AgentQuery) First(ctx context.Context) (*Agent, error)

First returns the first Agent entity from the query. Returns a *NotFoundError when no Agent was found.

func (*AgentQuery) FirstID

func (aq *AgentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Agent ID from the query. Returns a *NotFoundError when no Agent ID was found.

func (*AgentQuery) FirstIDX

func (aq *AgentQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*AgentQuery) FirstX

func (aq *AgentQuery) FirstX(ctx context.Context) *Agent

FirstX is like First, but panics if an error occurs.

func (*AgentQuery) GroupBy

func (aq *AgentQuery) GroupBy(field string, fields ...string) *AgentGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Agent.Query().
	GroupBy(agent.FieldCreateTime).
	Aggregate(memory.Count()).
	Scan(ctx, &v)

func (*AgentQuery) IDs

func (aq *AgentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Agent IDs.

func (*AgentQuery) IDsX

func (aq *AgentQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*AgentQuery) Limit

func (aq *AgentQuery) Limit(limit int) *AgentQuery

Limit the number of records to be returned by this query.

func (*AgentQuery) Modify

func (aq *AgentQuery) Modify(modifiers ...func(s *sql.Selector)) *AgentSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*AgentQuery) Offset

func (aq *AgentQuery) Offset(offset int) *AgentQuery

Offset to start from.

func (*AgentQuery) Only

func (aq *AgentQuery) Only(ctx context.Context) (*Agent, error)

Only returns a single Agent entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Agent entity is found. Returns a *NotFoundError when no Agent entities are found.

func (*AgentQuery) OnlyID

func (aq *AgentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Agent ID in the query. Returns a *NotSingularError when more than one Agent ID is found. Returns a *NotFoundError when no entities are found.

func (*AgentQuery) OnlyIDX

func (aq *AgentQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*AgentQuery) OnlyX

func (aq *AgentQuery) OnlyX(ctx context.Context) *Agent

OnlyX is like Only, but panics if an error occurs.

func (*AgentQuery) Order

func (aq *AgentQuery) Order(o ...agent.OrderOption) *AgentQuery

Order specifies how the records should be ordered.

func (*AgentQuery) QueryMessages

func (aq *AgentQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*AgentQuery) QueryModel

func (aq *AgentQuery) QueryModel() *ModelQuery

QueryModel chains the current query on the "model" edge.

func (*AgentQuery) QueryTasks

func (aq *AgentQuery) QueryTasks() *TaskQuery

QueryTasks chains the current query on the "tasks" edge.

func (*AgentQuery) Select

func (aq *AgentQuery) Select(fields ...string) *AgentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Agent.Query().
	Select(agent.FieldCreateTime).
	Scan(ctx, &v)

func (*AgentQuery) Unique

func (aq *AgentQuery) Unique(unique bool) *AgentQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*AgentQuery) Where

func (aq *AgentQuery) Where(ps ...predicate.Agent) *AgentQuery

Where adds a new predicate for the AgentQuery builder.

func (*AgentQuery) WithMessages

func (aq *AgentQuery) WithMessages(opts ...func(*MessageQuery)) *AgentQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

func (*AgentQuery) WithModel

func (aq *AgentQuery) WithModel(opts ...func(*ModelQuery)) *AgentQuery

WithModel tells the query-builder to eager-load the nodes that are connected to the "model" edge. The optional arguments are used to configure the query builder of the edge.

func (*AgentQuery) WithTasks

func (aq *AgentQuery) WithTasks(opts ...func(*TaskQuery)) *AgentQuery

WithTasks tells the query-builder to eager-load the nodes that are connected to the "tasks" edge. The optional arguments are used to configure the query builder of the edge.

type AgentSelect

type AgentSelect struct {
	*AgentQuery
	// contains filtered or unexported fields
}

AgentSelect is the builder for selecting fields of Agent entities.

func (*AgentSelect) Aggregate

func (as *AgentSelect) Aggregate(fns ...AggregateFunc) *AgentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AgentSelect) Bool

func (s *AgentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AgentSelect) BoolX

func (s *AgentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AgentSelect) Bools

func (s *AgentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AgentSelect) BoolsX

func (s *AgentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AgentSelect) Float64

func (s *AgentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AgentSelect) Float64X

func (s *AgentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AgentSelect) Float64s

func (s *AgentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AgentSelect) Float64sX

func (s *AgentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AgentSelect) Int

func (s *AgentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AgentSelect) IntX

func (s *AgentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AgentSelect) Ints

func (s *AgentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AgentSelect) IntsX

func (s *AgentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AgentSelect) Modify

func (as *AgentSelect) Modify(modifiers ...func(s *sql.Selector)) *AgentSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*AgentSelect) Scan

func (as *AgentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*AgentSelect) ScanX

func (s *AgentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*AgentSelect) String

func (s *AgentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AgentSelect) StringX

func (s *AgentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AgentSelect) Strings

func (s *AgentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AgentSelect) StringsX

func (s *AgentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AgentUpdate

type AgentUpdate struct {
	// contains filtered or unexported fields
}

AgentUpdate is the builder for updating Agent entities.

func (*AgentUpdate) AddMessageIDs

func (au *AgentUpdate) AddMessageIDs(ids ...uuid.UUID) *AgentUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*AgentUpdate) AddMessages

func (au *AgentUpdate) AddMessages(m ...*Message) *AgentUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*AgentUpdate) AddTaskIDs

func (au *AgentUpdate) AddTaskIDs(ids ...uuid.UUID) *AgentUpdate

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*AgentUpdate) AddTasks

func (au *AgentUpdate) AddTasks(t ...*Task) *AgentUpdate

AddTasks adds the "tasks" edges to the Task entity.

func (*AgentUpdate) ClearDescription

func (au *AgentUpdate) ClearDescription() *AgentUpdate

ClearDescription clears the value of the "description" field.

func (*AgentUpdate) ClearMessages

func (au *AgentUpdate) ClearMessages() *AgentUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*AgentUpdate) ClearModel

func (au *AgentUpdate) ClearModel() *AgentUpdate

ClearModel clears the "model" edge to the Model entity.

func (*AgentUpdate) ClearModelID

func (au *AgentUpdate) ClearModelID() *AgentUpdate

ClearModelID clears the value of the "model_id" field.

func (*AgentUpdate) ClearTasks

func (au *AgentUpdate) ClearTasks() *AgentUpdate

ClearTasks clears all "tasks" edges to the Task entity.

func (*AgentUpdate) Exec

func (au *AgentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgentUpdate) ExecX

func (au *AgentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgentUpdate) Modify

func (au *AgentUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AgentUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*AgentUpdate) Mutation

func (au *AgentUpdate) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdate) RemoveMessageIDs

func (au *AgentUpdate) RemoveMessageIDs(ids ...uuid.UUID) *AgentUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*AgentUpdate) RemoveMessages

func (au *AgentUpdate) RemoveMessages(m ...*Message) *AgentUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*AgentUpdate) RemoveTaskIDs

func (au *AgentUpdate) RemoveTaskIDs(ids ...uuid.UUID) *AgentUpdate

RemoveTaskIDs removes the "tasks" edge to Task entities by IDs.

func (*AgentUpdate) RemoveTasks

func (au *AgentUpdate) RemoveTasks(t ...*Task) *AgentUpdate

RemoveTasks removes "tasks" edges to Task entities.

func (*AgentUpdate) Save

func (au *AgentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*AgentUpdate) SaveX

func (au *AgentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*AgentUpdate) SetBuiltin

func (au *AgentUpdate) SetBuiltin(b bool) *AgentUpdate

SetBuiltin sets the "builtin" field.

func (*AgentUpdate) SetDescription

func (au *AgentUpdate) SetDescription(s string) *AgentUpdate

SetDescription sets the "description" field.

func (*AgentUpdate) SetInstructions

func (au *AgentUpdate) SetInstructions(s string) *AgentUpdate

SetInstructions sets the "instructions" field.

func (*AgentUpdate) SetModel

func (au *AgentUpdate) SetModel(m *Model) *AgentUpdate

SetModel sets the "model" edge to the Model entity.

func (*AgentUpdate) SetModelID

func (au *AgentUpdate) SetModelID(u uuid.UUID) *AgentUpdate

SetModelID sets the "model_id" field.

func (*AgentUpdate) SetName

func (au *AgentUpdate) SetName(s string) *AgentUpdate

SetName sets the "name" field.

func (*AgentUpdate) SetNillableBuiltin

func (au *AgentUpdate) SetNillableBuiltin(b *bool) *AgentUpdate

SetNillableBuiltin sets the "builtin" field if the given value is not nil.

func (*AgentUpdate) SetNillableDescription

func (au *AgentUpdate) SetNillableDescription(s *string) *AgentUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AgentUpdate) SetNillableInstructions

func (au *AgentUpdate) SetNillableInstructions(s *string) *AgentUpdate

SetNillableInstructions sets the "instructions" field if the given value is not nil.

func (*AgentUpdate) SetNillableModelID

func (au *AgentUpdate) SetNillableModelID(u *uuid.UUID) *AgentUpdate

SetNillableModelID sets the "model_id" field if the given value is not nil.

func (*AgentUpdate) SetNillableName

func (au *AgentUpdate) SetNillableName(s *string) *AgentUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*AgentUpdate) SetUpdateTime

func (au *AgentUpdate) SetUpdateTime(t time.Time) *AgentUpdate

SetUpdateTime sets the "update_time" field.

func (*AgentUpdate) Where

func (au *AgentUpdate) Where(ps ...predicate.Agent) *AgentUpdate

Where appends a list predicates to the AgentUpdate builder.

type AgentUpdateOne

type AgentUpdateOne struct {
	// contains filtered or unexported fields
}

AgentUpdateOne is the builder for updating a single Agent entity.

func (*AgentUpdateOne) AddMessageIDs

func (auo *AgentUpdateOne) AddMessageIDs(ids ...uuid.UUID) *AgentUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*AgentUpdateOne) AddMessages

func (auo *AgentUpdateOne) AddMessages(m ...*Message) *AgentUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*AgentUpdateOne) AddTaskIDs

func (auo *AgentUpdateOne) AddTaskIDs(ids ...uuid.UUID) *AgentUpdateOne

AddTaskIDs adds the "tasks" edge to the Task entity by IDs.

func (*AgentUpdateOne) AddTasks

func (auo *AgentUpdateOne) AddTasks(t ...*Task) *AgentUpdateOne

AddTasks adds the "tasks" edges to the Task entity.

func (*AgentUpdateOne) ClearDescription

func (auo *AgentUpdateOne) ClearDescription() *AgentUpdateOne

ClearDescription clears the value of the "description" field.

func (*AgentUpdateOne) ClearMessages

func (auo *AgentUpdateOne) ClearMessages() *AgentUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*AgentUpdateOne) ClearModel

func (auo *AgentUpdateOne) ClearModel() *AgentUpdateOne

ClearModel clears the "model" edge to the Model entity.

func (*AgentUpdateOne) ClearModelID

func (auo *AgentUpdateOne) ClearModelID() *AgentUpdateOne

ClearModelID clears the value of the "model_id" field.

func (*AgentUpdateOne) ClearTasks

func (auo *AgentUpdateOne) ClearTasks() *AgentUpdateOne

ClearTasks clears all "tasks" edges to the Task entity.

func (*AgentUpdateOne) Exec

func (auo *AgentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AgentUpdateOne) ExecX

func (auo *AgentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgentUpdateOne) Modify

func (auo *AgentUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AgentUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*AgentUpdateOne) Mutation

func (auo *AgentUpdateOne) Mutation() *AgentMutation

Mutation returns the AgentMutation object of the builder.

func (*AgentUpdateOne) RemoveMessageIDs

func (auo *AgentUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *AgentUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*AgentUpdateOne) RemoveMessages

func (auo *AgentUpdateOne) RemoveMessages(m ...*Message) *AgentUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*AgentUpdateOne) RemoveTaskIDs

func (auo *AgentUpdateOne) RemoveTaskIDs(ids ...uuid.UUID) *AgentUpdateOne

RemoveTaskIDs removes the "tasks" edge to Task entities by IDs.

func (*AgentUpdateOne) RemoveTasks

func (auo *AgentUpdateOne) RemoveTasks(t ...*Task) *AgentUpdateOne

RemoveTasks removes "tasks" edges to Task entities.

func (*AgentUpdateOne) Save

func (auo *AgentUpdateOne) Save(ctx context.Context) (*Agent, error)

Save executes the query and returns the updated Agent entity.

func (*AgentUpdateOne) SaveX

func (auo *AgentUpdateOne) SaveX(ctx context.Context) *Agent

SaveX is like Save, but panics if an error occurs.

func (*AgentUpdateOne) Select

func (auo *AgentUpdateOne) Select(field string, fields ...string) *AgentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AgentUpdateOne) SetBuiltin

func (auo *AgentUpdateOne) SetBuiltin(b bool) *AgentUpdateOne

SetBuiltin sets the "builtin" field.

func (*AgentUpdateOne) SetDescription

func (auo *AgentUpdateOne) SetDescription(s string) *AgentUpdateOne

SetDescription sets the "description" field.

func (*AgentUpdateOne) SetInstructions

func (auo *AgentUpdateOne) SetInstructions(s string) *AgentUpdateOne

SetInstructions sets the "instructions" field.

func (*AgentUpdateOne) SetModel

func (auo *AgentUpdateOne) SetModel(m *Model) *AgentUpdateOne

SetModel sets the "model" edge to the Model entity.

func (*AgentUpdateOne) SetModelID

func (auo *AgentUpdateOne) SetModelID(u uuid.UUID) *AgentUpdateOne

SetModelID sets the "model_id" field.

func (*AgentUpdateOne) SetName

func (auo *AgentUpdateOne) SetName(s string) *AgentUpdateOne

SetName sets the "name" field.

func (*AgentUpdateOne) SetNillableBuiltin

func (auo *AgentUpdateOne) SetNillableBuiltin(b *bool) *AgentUpdateOne

SetNillableBuiltin sets the "builtin" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableDescription

func (auo *AgentUpdateOne) SetNillableDescription(s *string) *AgentUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableInstructions

func (auo *AgentUpdateOne) SetNillableInstructions(s *string) *AgentUpdateOne

SetNillableInstructions sets the "instructions" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableModelID

func (auo *AgentUpdateOne) SetNillableModelID(u *uuid.UUID) *AgentUpdateOne

SetNillableModelID sets the "model_id" field if the given value is not nil.

func (*AgentUpdateOne) SetNillableName

func (auo *AgentUpdateOne) SetNillableName(s *string) *AgentUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*AgentUpdateOne) SetUpdateTime

func (auo *AgentUpdateOne) SetUpdateTime(t time.Time) *AgentUpdateOne

SetUpdateTime sets the "update_time" field.

func (*AgentUpdateOne) Where

func (auo *AgentUpdateOne) Where(ps ...predicate.Agent) *AgentUpdateOne

Where appends a list predicates to the AgentUpdate builder.

type Agents

type Agents []*Agent

Agents is a parsable slice of Agent.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(memory.As(memory.Sum(field1), "sum_field1"), (memory.As(memory.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Model is the client for interacting with the Model builders.
	Model *ModelClient
	// ModelProvider is the client for interacting with the ModelProvider builders.
	ModelProvider *ModelProviderClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) DB

func (c *Client) DB() *sql.DB

DB returns the underlying *sql.DB, or nil if the driver is not *entsql.Driver

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Agent.
	Query().
	Count(ctx)

func (*Client) Driver

func (c *Client) Driver() dialect.Driver

Driver returns the underlying dialect.Driver

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) MustDB

func (c *Client) MustDB() *sql.DB

MustDB returns the underlying *sql.DB or panics if the driver is not *entsql.Driver

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Message

type Message struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Source holds the value of the "source" field.
	Source types.MessageSource `json:"source,omitempty"`
	// Content holds the value of the "content" field.
	Content *types.MessageContent `json:"content,omitempty"`
	// Usage holds the value of the "usage" field.
	Usage *types.MessageUsage `json:"usage,omitempty"`
	// ProcessedTime holds the value of the "processed_time" field.
	ProcessedTime time.Time `json:"processed_time,omitempty"`
	// TaskID holds the value of the "task_id" field.
	TaskID uuid.UUID `json:"task_id,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	// ModelID holds the value of the "model_id" field.
	ModelID uuid.UUID `json:"model_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryAgent

func (m *Message) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the Message entity.

func (*Message) QueryModel

func (m *Message) QueryModel() *ModelQuery

QueryModel queries the "model" edge of the Message entity.

func (*Message) QueryTask

func (m *Message) QueryTask() *TaskQuery

QueryTask queries the "task" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (m *Message) Unwrap() *Message

Unwrap unwraps the Message entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Message) Update

func (m *Message) Update() *MessageUpdateOne

Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.

func (*Message) Value

func (m *Message) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Message. This includes values selected through modifiers, order, etc.

type MessageClient

type MessageClient struct {
	// contains filtered or unexported fields
}

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

CreateBulk returns a builder for creating a bulk of Message entities.

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message

GetX is like Get, but panics if an error occurs.

func (*MessageClient) Hooks

func (c *MessageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MessageClient) Intercept

func (c *MessageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `message.Intercept(f(g(h())))`.

func (*MessageClient) Interceptors

func (c *MessageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryAgent

func (c *MessageClient) QueryAgent(m *Message) *AgentQuery

QueryAgent queries the agent edge of a Message.

func (*MessageClient) QueryModel

func (c *MessageClient) QueryModel(m *Message) *ModelQuery

QueryModel queries the model edge of a Message.

func (*MessageClient) QueryTask

func (c *MessageClient) QueryTask(m *Message) *TaskQuery

QueryTask queries the task edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

func (c *MessageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.

type MessageCreate

type MessageCreate struct {
	// contains filtered or unexported fields
}

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (mc *MessageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreate) Mutation

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetAgent

func (mc *MessageCreate) SetAgent(a *Agent) *MessageCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*MessageCreate) SetAgentID

func (mc *MessageCreate) SetAgentID(u uuid.UUID) *MessageCreate

SetAgentID sets the "agent_id" field.

func (*MessageCreate) SetContent

func (mc *MessageCreate) SetContent(tc *types.MessageContent) *MessageCreate

SetContent sets the "content" field.

func (*MessageCreate) SetCreateTime

func (mc *MessageCreate) SetCreateTime(t time.Time) *MessageCreate

SetCreateTime sets the "create_time" field.

func (*MessageCreate) SetID

func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate

SetID sets the "id" field.

func (*MessageCreate) SetModel

func (mc *MessageCreate) SetModel(m *Model) *MessageCreate

SetModel sets the "model" edge to the Model entity.

func (*MessageCreate) SetModelID

func (mc *MessageCreate) SetModelID(u uuid.UUID) *MessageCreate

SetModelID sets the "model_id" field.

func (*MessageCreate) SetNillableAgentID

func (mc *MessageCreate) SetNillableAgentID(u *uuid.UUID) *MessageCreate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*MessageCreate) SetNillableCreateTime

func (mc *MessageCreate) SetNillableCreateTime(t *time.Time) *MessageCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MessageCreate) SetNillableID

func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MessageCreate) SetNillableModelID

func (mc *MessageCreate) SetNillableModelID(u *uuid.UUID) *MessageCreate

SetNillableModelID sets the "model_id" field if the given value is not nil.

func (*MessageCreate) SetNillableProcessedTime

func (mc *MessageCreate) SetNillableProcessedTime(t *time.Time) *MessageCreate

SetNillableProcessedTime sets the "processed_time" field if the given value is not nil.

func (*MessageCreate) SetNillableUpdateTime

func (mc *MessageCreate) SetNillableUpdateTime(t *time.Time) *MessageCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MessageCreate) SetProcessedTime

func (mc *MessageCreate) SetProcessedTime(t time.Time) *MessageCreate

SetProcessedTime sets the "processed_time" field.

func (*MessageCreate) SetSource

func (mc *MessageCreate) SetSource(ts types.MessageSource) *MessageCreate

SetSource sets the "source" field.

func (*MessageCreate) SetTask

func (mc *MessageCreate) SetTask(t *Task) *MessageCreate

SetTask sets the "task" edge to the Task entity.

func (*MessageCreate) SetTaskID

func (mc *MessageCreate) SetTaskID(u uuid.UUID) *MessageCreate

SetTaskID sets the "task_id" field.

func (*MessageCreate) SetUpdateTime

func (mc *MessageCreate) SetUpdateTime(t time.Time) *MessageCreate

SetUpdateTime sets the "update_time" field.

func (*MessageCreate) SetUsage

func (mc *MessageCreate) SetUsage(tu *types.MessageUsage) *MessageCreate

SetUsage sets the "usage" field.

type MessageCreateBulk

type MessageCreateBulk struct {
	// contains filtered or unexported fields
}

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreateBulk) Save

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

SaveX is like Save, but panics if an error occurs.

type MessageDelete

type MessageDelete struct {
	// contains filtered or unexported fields
}

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MessageDelete) ExecX

func (md *MessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageDelete) Where

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

type MessageDeleteOne struct {
	// contains filtered or unexported fields
}

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Task holds the value of the task edge.
	Task *Task `json:"task,omitempty"`
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// Model holds the value of the model edge.
	Model *Model `json:"model,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) AgentOrErr

func (e MessageEdges) AgentOrErr() (*Agent, error)

AgentOrErr returns the Agent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MessageEdges) ModelOrErr

func (e MessageEdges) ModelOrErr() (*Model, error)

ModelOrErr returns the Model value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MessageEdges) TaskOrErr

func (e MessageEdges) TaskOrErr() (*Task, error)

TaskOrErr returns the Task value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MessageGroupBy

type MessageGroupBy struct {
	// contains filtered or unexported fields
}

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageGroupBy) Bool

func (s *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolX

func (s *MessageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageGroupBy) Bools

func (s *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolsX

func (s *MessageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageGroupBy) Float64

func (s *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64X

func (s *MessageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageGroupBy) Float64s

func (s *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64sX

func (s *MessageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageGroupBy) Int

func (s *MessageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntX

func (s *MessageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageGroupBy) Ints

func (s *MessageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntsX

func (s *MessageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageGroupBy) Scan

func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageGroupBy) ScanX

func (s *MessageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageGroupBy) String

func (s *MessageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringX

func (s *MessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageGroupBy) Strings

func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringsX

func (s *MessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageMutation

type MessageMutation struct {
	// contains filtered or unexported fields
}

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) AgentCleared

func (m *MessageMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*MessageMutation) AgentID

func (m *MessageMutation) AgentID() (r uuid.UUID, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*MessageMutation) AgentIDCleared

func (m *MessageMutation) AgentIDCleared() bool

AgentIDCleared returns if the "agent_id" field was cleared in this mutation.

func (*MessageMutation) AgentIDs

func (m *MessageMutation) AgentIDs() (ids []uuid.UUID)

AgentIDs returns the "agent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AgentID instead. It exists only for internal usage by the builders.

func (*MessageMutation) ClearAgent

func (m *MessageMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*MessageMutation) ClearAgentID

func (m *MessageMutation) ClearAgentID()

ClearAgentID clears the value of the "agent_id" field.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MessageMutation) ClearField

func (m *MessageMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageMutation) ClearModel

func (m *MessageMutation) ClearModel()

ClearModel clears the "model" edge to the Model entity.

func (*MessageMutation) ClearModelID

func (m *MessageMutation) ClearModelID()

ClearModelID clears the value of the "model_id" field.

func (*MessageMutation) ClearProcessedTime

func (m *MessageMutation) ClearProcessedTime()

ClearProcessedTime clears the value of the "processed_time" field.

func (*MessageMutation) ClearTask

func (m *MessageMutation) ClearTask()

ClearTask clears the "task" edge to the Task entity.

func (*MessageMutation) ClearUsage

func (m *MessageMutation) ClearUsage()

ClearUsage clears the value of the "usage" field.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MessageMutation) Content

func (m *MessageMutation) Content() (r *types.MessageContent, exists bool)

Content returns the value of the "content" field in the mutation.

func (*MessageMutation) CreateTime

func (m *MessageMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Field

func (m *MessageMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MessageMutation) ID

func (m *MessageMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MessageMutation) ModelCleared

func (m *MessageMutation) ModelCleared() bool

ModelCleared reports if the "model" edge to the Model entity was cleared.

func (*MessageMutation) ModelID

func (m *MessageMutation) ModelID() (r uuid.UUID, exists bool)

ModelID returns the value of the "model_id" field in the mutation.

func (*MessageMutation) ModelIDCleared

func (m *MessageMutation) ModelIDCleared() bool

ModelIDCleared returns if the "model_id" field was cleared in this mutation.

func (*MessageMutation) ModelIDs

func (m *MessageMutation) ModelIDs() (ids []uuid.UUID)

ModelIDs returns the "model" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ModelID instead. It exists only for internal usage by the builders.

func (*MessageMutation) OldAgentID

func (m *MessageMutation) OldAgentID(ctx context.Context) (v uuid.UUID, err error)

OldAgentID returns the old "agent_id" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldContent

func (m *MessageMutation) OldContent(ctx context.Context) (v *types.MessageContent, err error)

OldContent returns the old "content" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldCreateTime

func (m *MessageMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldField

func (m *MessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MessageMutation) OldModelID

func (m *MessageMutation) OldModelID(ctx context.Context) (v uuid.UUID, err error)

OldModelID returns the old "model_id" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldProcessedTime

func (m *MessageMutation) OldProcessedTime(ctx context.Context) (v time.Time, err error)

OldProcessedTime returns the old "processed_time" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldSource

func (m *MessageMutation) OldSource(ctx context.Context) (v types.MessageSource, err error)

OldSource returns the old "source" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldTaskID

func (m *MessageMutation) OldTaskID(ctx context.Context) (v uuid.UUID, err error)

OldTaskID returns the old "task_id" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldUpdateTime

func (m *MessageMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldUsage

func (m *MessageMutation) OldUsage(ctx context.Context) (v *types.MessageUsage, err error)

OldUsage returns the old "usage" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) ProcessedTime

func (m *MessageMutation) ProcessedTime() (r time.Time, exists bool)

ProcessedTime returns the value of the "processed_time" field in the mutation.

func (*MessageMutation) ProcessedTimeCleared

func (m *MessageMutation) ProcessedTimeCleared() bool

ProcessedTimeCleared returns if the "processed_time" field was cleared in this mutation.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MessageMutation) ResetAgent

func (m *MessageMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*MessageMutation) ResetAgentID

func (m *MessageMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*MessageMutation) ResetContent

func (m *MessageMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*MessageMutation) ResetCreateTime

func (m *MessageMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MessageMutation) ResetField

func (m *MessageMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageMutation) ResetModel

func (m *MessageMutation) ResetModel()

ResetModel resets all changes to the "model" edge.

func (*MessageMutation) ResetModelID

func (m *MessageMutation) ResetModelID()

ResetModelID resets all changes to the "model_id" field.

func (*MessageMutation) ResetProcessedTime

func (m *MessageMutation) ResetProcessedTime()

ResetProcessedTime resets all changes to the "processed_time" field.

func (*MessageMutation) ResetSource

func (m *MessageMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*MessageMutation) ResetTask

func (m *MessageMutation) ResetTask()

ResetTask resets all changes to the "task" edge.

func (*MessageMutation) ResetTaskID

func (m *MessageMutation) ResetTaskID()

ResetTaskID resets all changes to the "task_id" field.

func (*MessageMutation) ResetUpdateTime

func (m *MessageMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MessageMutation) ResetUsage

func (m *MessageMutation) ResetUsage()

ResetUsage resets all changes to the "usage" field.

func (*MessageMutation) SetAgentID

func (m *MessageMutation) SetAgentID(u uuid.UUID)

SetAgentID sets the "agent_id" field.

func (*MessageMutation) SetContent

func (m *MessageMutation) SetContent(tc *types.MessageContent)

SetContent sets the "content" field.

func (*MessageMutation) SetCreateTime

func (m *MessageMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MessageMutation) SetField

func (m *MessageMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageMutation) SetID

func (m *MessageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Message entities.

func (*MessageMutation) SetModelID

func (m *MessageMutation) SetModelID(u uuid.UUID)

SetModelID sets the "model_id" field.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetProcessedTime

func (m *MessageMutation) SetProcessedTime(t time.Time)

SetProcessedTime sets the "processed_time" field.

func (*MessageMutation) SetSource

func (m *MessageMutation) SetSource(ts types.MessageSource)

SetSource sets the "source" field.

func (*MessageMutation) SetTaskID

func (m *MessageMutation) SetTaskID(u uuid.UUID)

SetTaskID sets the "task_id" field.

func (*MessageMutation) SetUpdateTime

func (m *MessageMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*MessageMutation) SetUsage

func (m *MessageMutation) SetUsage(tu *types.MessageUsage)

SetUsage sets the "usage" field.

func (*MessageMutation) Source

func (m *MessageMutation) Source() (r types.MessageSource, exists bool)

Source returns the value of the "source" field in the mutation.

func (*MessageMutation) TaskCleared

func (m *MessageMutation) TaskCleared() bool

TaskCleared reports if the "task" edge to the Task entity was cleared.

func (*MessageMutation) TaskID

func (m *MessageMutation) TaskID() (r uuid.UUID, exists bool)

TaskID returns the value of the "task_id" field in the mutation.

func (*MessageMutation) TaskIDs

func (m *MessageMutation) TaskIDs() (ids []uuid.UUID)

TaskIDs returns the "task" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TaskID instead. It exists only for internal usage by the builders.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) UpdateTime

func (m *MessageMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MessageMutation) Usage

func (m *MessageMutation) Usage() (r *types.MessageUsage, exists bool)

Usage returns the value of the "usage" field in the mutation.

func (*MessageMutation) UsageCleared

func (m *MessageMutation) UsageCleared() bool

UsageCleared returns if the "usage" field was cleared in this mutation.

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MessageQuery

type MessageQuery struct {
	// contains filtered or unexported fields
}

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

AllX is like All, but panics if an error occurs.

func (*MessageQuery) Clone

func (mq *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (mq *MessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageQuery) Exist

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageQuery) ExistX

func (mq *MessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageQuery) First

func (mq *MessageQuery) First(ctx context.Context) (*Message, error)

First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.

func (*MessageQuery) FirstID

func (mq *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.

func (*MessageQuery) FirstIDX

func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageQuery) FirstX

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

FirstX is like First, but panics if an error occurs.

func (*MessageQuery) GroupBy

func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldCreateTime).
	Aggregate(memory.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (mq *MessageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Message IDs.

func (*MessageQuery) IDsX

func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*MessageQuery) Limit

func (mq *MessageQuery) Limit(limit int) *MessageQuery

Limit the number of records to be returned by this query.

func (*MessageQuery) Modify

func (mq *MessageQuery) Modify(modifiers ...func(s *sql.Selector)) *MessageSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*MessageQuery) Offset

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (mq *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageQuery) OnlyX

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

OnlyX is like Only, but panics if an error occurs.

func (*MessageQuery) Order

func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryAgent

func (mq *MessageQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*MessageQuery) QueryModel

func (mq *MessageQuery) QueryModel() *ModelQuery

QueryModel chains the current query on the "model" edge.

func (*MessageQuery) QueryTask

func (mq *MessageQuery) QueryTask() *TaskQuery

QueryTask chains the current query on the "task" edge.

func (*MessageQuery) Select

func (mq *MessageQuery) Select(fields ...string) *MessageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Message.Query().
	Select(message.FieldCreateTime).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (mq *MessageQuery) Unique(unique bool) *MessageQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MessageQuery) Where

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithAgent

func (mq *MessageQuery) WithAgent(opts ...func(*AgentQuery)) *MessageQuery

WithAgent tells the query-builder to eager-load the nodes that are connected to the "agent" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithModel

func (mq *MessageQuery) WithModel(opts ...func(*ModelQuery)) *MessageQuery

WithModel tells the query-builder to eager-load the nodes that are connected to the "model" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithTask

func (mq *MessageQuery) WithTask(opts ...func(*TaskQuery)) *MessageQuery

WithTask tells the query-builder to eager-load the nodes that are connected to the "task" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolX

func (s *MessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageSelect) Bools

func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolsX

func (s *MessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageSelect) Float64

func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64X

func (s *MessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageSelect) Float64s

func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64sX

func (s *MessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageSelect) Int

func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntX

func (s *MessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageSelect) Ints

func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntsX

func (s *MessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageSelect) Modify

func (ms *MessageSelect) Modify(modifiers ...func(s *sql.Selector)) *MessageSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*MessageSelect) Scan

func (ms *MessageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageSelect) ScanX

func (s *MessageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageSelect) String

func (s *MessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (s *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (s *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) ClearAgent

func (mu *MessageUpdate) ClearAgent() *MessageUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*MessageUpdate) ClearAgentID

func (mu *MessageUpdate) ClearAgentID() *MessageUpdate

ClearAgentID clears the value of the "agent_id" field.

func (*MessageUpdate) ClearModel

func (mu *MessageUpdate) ClearModel() *MessageUpdate

ClearModel clears the "model" edge to the Model entity.

func (*MessageUpdate) ClearModelID

func (mu *MessageUpdate) ClearModelID() *MessageUpdate

ClearModelID clears the value of the "model_id" field.

func (*MessageUpdate) ClearProcessedTime

func (mu *MessageUpdate) ClearProcessedTime() *MessageUpdate

ClearProcessedTime clears the value of the "processed_time" field.

func (*MessageUpdate) ClearTask

func (mu *MessageUpdate) ClearTask() *MessageUpdate

ClearTask clears the "task" edge to the Task entity.

func (*MessageUpdate) ClearUsage

func (mu *MessageUpdate) ClearUsage() *MessageUpdate

ClearUsage clears the value of the "usage" field.

func (*MessageUpdate) Exec

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (mu *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Modify

func (mu *MessageUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MessageUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*MessageUpdate) Mutation

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save

func (mu *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (mu *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetAgent

func (mu *MessageUpdate) SetAgent(a *Agent) *MessageUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*MessageUpdate) SetAgentID

func (mu *MessageUpdate) SetAgentID(u uuid.UUID) *MessageUpdate

SetAgentID sets the "agent_id" field.

func (*MessageUpdate) SetContent

func (mu *MessageUpdate) SetContent(tc *types.MessageContent) *MessageUpdate

SetContent sets the "content" field.

func (*MessageUpdate) SetModel

func (mu *MessageUpdate) SetModel(m *Model) *MessageUpdate

SetModel sets the "model" edge to the Model entity.

func (*MessageUpdate) SetModelID

func (mu *MessageUpdate) SetModelID(u uuid.UUID) *MessageUpdate

SetModelID sets the "model_id" field.

func (*MessageUpdate) SetNillableAgentID

func (mu *MessageUpdate) SetNillableAgentID(u *uuid.UUID) *MessageUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableModelID

func (mu *MessageUpdate) SetNillableModelID(u *uuid.UUID) *MessageUpdate

SetNillableModelID sets the "model_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableProcessedTime

func (mu *MessageUpdate) SetNillableProcessedTime(t *time.Time) *MessageUpdate

SetNillableProcessedTime sets the "processed_time" field if the given value is not nil.

func (*MessageUpdate) SetNillableSource

func (mu *MessageUpdate) SetNillableSource(ts *types.MessageSource) *MessageUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*MessageUpdate) SetNillableTaskID

func (mu *MessageUpdate) SetNillableTaskID(u *uuid.UUID) *MessageUpdate

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*MessageUpdate) SetProcessedTime

func (mu *MessageUpdate) SetProcessedTime(t time.Time) *MessageUpdate

SetProcessedTime sets the "processed_time" field.

func (*MessageUpdate) SetSource

func (mu *MessageUpdate) SetSource(ts types.MessageSource) *MessageUpdate

SetSource sets the "source" field.

func (*MessageUpdate) SetTask

func (mu *MessageUpdate) SetTask(t *Task) *MessageUpdate

SetTask sets the "task" edge to the Task entity.

func (*MessageUpdate) SetTaskID

func (mu *MessageUpdate) SetTaskID(u uuid.UUID) *MessageUpdate

SetTaskID sets the "task_id" field.

func (*MessageUpdate) SetUpdateTime

func (mu *MessageUpdate) SetUpdateTime(t time.Time) *MessageUpdate

SetUpdateTime sets the "update_time" field.

func (*MessageUpdate) SetUsage

func (mu *MessageUpdate) SetUsage(tu *types.MessageUsage) *MessageUpdate

SetUsage sets the "usage" field.

func (*MessageUpdate) Where

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) ClearAgent

func (muo *MessageUpdateOne) ClearAgent() *MessageUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*MessageUpdateOne) ClearAgentID

func (muo *MessageUpdateOne) ClearAgentID() *MessageUpdateOne

ClearAgentID clears the value of the "agent_id" field.

func (*MessageUpdateOne) ClearModel

func (muo *MessageUpdateOne) ClearModel() *MessageUpdateOne

ClearModel clears the "model" edge to the Model entity.

func (*MessageUpdateOne) ClearModelID

func (muo *MessageUpdateOne) ClearModelID() *MessageUpdateOne

ClearModelID clears the value of the "model_id" field.

func (*MessageUpdateOne) ClearProcessedTime

func (muo *MessageUpdateOne) ClearProcessedTime() *MessageUpdateOne

ClearProcessedTime clears the value of the "processed_time" field.

func (*MessageUpdateOne) ClearTask

func (muo *MessageUpdateOne) ClearTask() *MessageUpdateOne

ClearTask clears the "task" edge to the Task entity.

func (*MessageUpdateOne) ClearUsage

func (muo *MessageUpdateOne) ClearUsage() *MessageUpdateOne

ClearUsage clears the value of the "usage" field.

func (*MessageUpdateOne) Exec

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Modify

func (muo *MessageUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MessageUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*MessageUpdateOne) Mutation

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetAgent

func (muo *MessageUpdateOne) SetAgent(a *Agent) *MessageUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*MessageUpdateOne) SetAgentID

func (muo *MessageUpdateOne) SetAgentID(u uuid.UUID) *MessageUpdateOne

SetAgentID sets the "agent_id" field.

func (*MessageUpdateOne) SetContent

func (muo *MessageUpdateOne) SetContent(tc *types.MessageContent) *MessageUpdateOne

SetContent sets the "content" field.

func (*MessageUpdateOne) SetModel

func (muo *MessageUpdateOne) SetModel(m *Model) *MessageUpdateOne

SetModel sets the "model" edge to the Model entity.

func (*MessageUpdateOne) SetModelID

func (muo *MessageUpdateOne) SetModelID(u uuid.UUID) *MessageUpdateOne

SetModelID sets the "model_id" field.

func (*MessageUpdateOne) SetNillableAgentID

func (muo *MessageUpdateOne) SetNillableAgentID(u *uuid.UUID) *MessageUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableModelID

func (muo *MessageUpdateOne) SetNillableModelID(u *uuid.UUID) *MessageUpdateOne

SetNillableModelID sets the "model_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableProcessedTime

func (muo *MessageUpdateOne) SetNillableProcessedTime(t *time.Time) *MessageUpdateOne

SetNillableProcessedTime sets the "processed_time" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableSource

func (muo *MessageUpdateOne) SetNillableSource(ts *types.MessageSource) *MessageUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableTaskID

func (muo *MessageUpdateOne) SetNillableTaskID(u *uuid.UUID) *MessageUpdateOne

SetNillableTaskID sets the "task_id" field if the given value is not nil.

func (*MessageUpdateOne) SetProcessedTime

func (muo *MessageUpdateOne) SetProcessedTime(t time.Time) *MessageUpdateOne

SetProcessedTime sets the "processed_time" field.

func (*MessageUpdateOne) SetSource

SetSource sets the "source" field.

func (*MessageUpdateOne) SetTask

func (muo *MessageUpdateOne) SetTask(t *Task) *MessageUpdateOne

SetTask sets the "task" edge to the Task entity.

func (*MessageUpdateOne) SetTaskID

func (muo *MessageUpdateOne) SetTaskID(u uuid.UUID) *MessageUpdateOne

SetTaskID sets the "task_id" field.

func (*MessageUpdateOne) SetUpdateTime

func (muo *MessageUpdateOne) SetUpdateTime(t time.Time) *MessageUpdateOne

SetUpdateTime sets the "update_time" field.

func (*MessageUpdateOne) SetUsage

SetUsage sets the "usage" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

type Model

type Model struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// ContextWindow holds the value of the "context_window" field.
	ContextWindow int64 `json:"context_window,omitempty"`
	// Capabilities holds the value of the "capabilities" field.
	Capabilities []types.ModelCapability `json:"capabilities,omitempty"`
	// InputCost holds the value of the "input_cost" field.
	InputCost float64 `json:"input_cost,omitempty"`
	// OutputCost holds the value of the "output_cost" field.
	OutputCost float64 `json:"output_cost,omitempty"`
	// CacheWriteCost holds the value of the "cache_write_cost" field.
	CacheWriteCost float64 `json:"cache_write_cost,omitempty"`
	// CacheReadCost holds the value of the "cache_read_cost" field.
	CacheReadCost float64 `json:"cache_read_cost,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// Alias holds the value of the "alias" field.
	Alias string `json:"alias,omitempty"`
	// ModelProviderID holds the value of the "model_provider_id" field.
	ModelProviderID uuid.UUID `json:"model_provider_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ModelQuery when eager-loading is set.
	Edges ModelEdges `json:"edges"`
	// contains filtered or unexported fields
}

Model is the model entity for the Model schema.

func (*Model) QueryAgents

func (m *Model) QueryAgents() *AgentQuery

QueryAgents queries the "agents" edge of the Model entity.

func (*Model) QueryMessages

func (m *Model) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Model entity.

func (*Model) QueryModelProvider

func (m *Model) QueryModelProvider() *ModelProviderQuery

QueryModelProvider queries the "model_provider" edge of the Model entity.

func (*Model) String

func (m *Model) String() string

String implements the fmt.Stringer.

func (*Model) Unwrap

func (m *Model) Unwrap() *Model

Unwrap unwraps the Model entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Model) Update

func (m *Model) Update() *ModelUpdateOne

Update returns a builder for updating this Model. Note that you need to call Model.Unwrap() before calling this method if this Model was returned from a transaction, and the transaction was committed or rolled back.

func (*Model) Value

func (m *Model) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Model. This includes values selected through modifiers, order, etc.

type ModelClient

type ModelClient struct {
	// contains filtered or unexported fields
}

ModelClient is a client for the Model schema.

func NewModelClient

func NewModelClient(c config) *ModelClient

NewModelClient returns a client for the Model from the given config.

func (*ModelClient) Create

func (c *ModelClient) Create() *ModelCreate

Create returns a builder for creating a Model entity.

func (*ModelClient) CreateBulk

func (c *ModelClient) CreateBulk(builders ...*ModelCreate) *ModelCreateBulk

CreateBulk returns a builder for creating a bulk of Model entities.

func (*ModelClient) Delete

func (c *ModelClient) Delete() *ModelDelete

Delete returns a delete builder for Model.

func (*ModelClient) DeleteOne

func (c *ModelClient) DeleteOne(m *Model) *ModelDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ModelClient) DeleteOneID

func (c *ModelClient) DeleteOneID(id uuid.UUID) *ModelDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ModelClient) Get

func (c *ModelClient) Get(ctx context.Context, id uuid.UUID) (*Model, error)

Get returns a Model entity by its id.

func (*ModelClient) GetX

func (c *ModelClient) GetX(ctx context.Context, id uuid.UUID) *Model

GetX is like Get, but panics if an error occurs.

func (*ModelClient) Hooks

func (c *ModelClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ModelClient) Intercept

func (c *ModelClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `model.Intercept(f(g(h())))`.

func (*ModelClient) Interceptors

func (c *ModelClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ModelClient) MapCreateBulk

func (c *ModelClient) MapCreateBulk(slice any, setFunc func(*ModelCreate, int)) *ModelCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ModelClient) Query

func (c *ModelClient) Query() *ModelQuery

Query returns a query builder for Model.

func (*ModelClient) QueryAgents

func (c *ModelClient) QueryAgents(m *Model) *AgentQuery

QueryAgents queries the agents edge of a Model.

func (*ModelClient) QueryMessages

func (c *ModelClient) QueryMessages(m *Model) *MessageQuery

QueryMessages queries the messages edge of a Model.

func (*ModelClient) QueryModelProvider

func (c *ModelClient) QueryModelProvider(m *Model) *ModelProviderQuery

QueryModelProvider queries the model_provider edge of a Model.

func (*ModelClient) Update

func (c *ModelClient) Update() *ModelUpdate

Update returns an update builder for Model.

func (*ModelClient) UpdateOne

func (c *ModelClient) UpdateOne(m *Model) *ModelUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ModelClient) UpdateOneID

func (c *ModelClient) UpdateOneID(id uuid.UUID) *ModelUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ModelClient) Use

func (c *ModelClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `model.Hooks(f(g(h())))`.

type ModelCreate

type ModelCreate struct {
	// contains filtered or unexported fields
}

ModelCreate is the builder for creating a Model entity.

func (*ModelCreate) AddAgentIDs

func (mc *ModelCreate) AddAgentIDs(ids ...uuid.UUID) *ModelCreate

AddAgentIDs adds the "agents" edge to the Agent entity by IDs.

func (*ModelCreate) AddAgents

func (mc *ModelCreate) AddAgents(a ...*Agent) *ModelCreate

AddAgents adds the "agents" edges to the Agent entity.

func (*ModelCreate) AddMessageIDs

func (mc *ModelCreate) AddMessageIDs(ids ...uuid.UUID) *ModelCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ModelCreate) AddMessages

func (mc *ModelCreate) AddMessages(m ...*Message) *ModelCreate

AddMessages adds the "messages" edges to the Message entity.

func (*ModelCreate) Exec

func (mc *ModelCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelCreate) ExecX

func (mc *ModelCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelCreate) Mutation

func (mc *ModelCreate) Mutation() *ModelMutation

Mutation returns the ModelMutation object of the builder.

func (*ModelCreate) Save

func (mc *ModelCreate) Save(ctx context.Context) (*Model, error)

Save creates the Model in the database.

func (*ModelCreate) SaveX

func (mc *ModelCreate) SaveX(ctx context.Context) *Model

SaveX calls Save and panics if Save returns an error.

func (*ModelCreate) SetAlias

func (mc *ModelCreate) SetAlias(s string) *ModelCreate

SetAlias sets the "alias" field.

func (*ModelCreate) SetCacheReadCost

func (mc *ModelCreate) SetCacheReadCost(f float64) *ModelCreate

SetCacheReadCost sets the "cache_read_cost" field.

func (*ModelCreate) SetCacheWriteCost

func (mc *ModelCreate) SetCacheWriteCost(f float64) *ModelCreate

SetCacheWriteCost sets the "cache_write_cost" field.

func (*ModelCreate) SetCapabilities

func (mc *ModelCreate) SetCapabilities(tc []types.ModelCapability) *ModelCreate

SetCapabilities sets the "capabilities" field.

func (*ModelCreate) SetContextWindow

func (mc *ModelCreate) SetContextWindow(i int64) *ModelCreate

SetContextWindow sets the "context_window" field.

func (*ModelCreate) SetCreateTime

func (mc *ModelCreate) SetCreateTime(t time.Time) *ModelCreate

SetCreateTime sets the "create_time" field.

func (*ModelCreate) SetEnabled

func (mc *ModelCreate) SetEnabled(b bool) *ModelCreate

SetEnabled sets the "enabled" field.

func (*ModelCreate) SetID

func (mc *ModelCreate) SetID(u uuid.UUID) *ModelCreate

SetID sets the "id" field.

func (*ModelCreate) SetInputCost

func (mc *ModelCreate) SetInputCost(f float64) *ModelCreate

SetInputCost sets the "input_cost" field.

func (*ModelCreate) SetModelProvider

func (mc *ModelCreate) SetModelProvider(m *ModelProvider) *ModelCreate

SetModelProvider sets the "model_provider" edge to the ModelProvider entity.

func (*ModelCreate) SetModelProviderID

func (mc *ModelCreate) SetModelProviderID(u uuid.UUID) *ModelCreate

SetModelProviderID sets the "model_provider_id" field.

func (*ModelCreate) SetName

func (mc *ModelCreate) SetName(s string) *ModelCreate

SetName sets the "name" field.

func (*ModelCreate) SetNillableAlias

func (mc *ModelCreate) SetNillableAlias(s *string) *ModelCreate

SetNillableAlias sets the "alias" field if the given value is not nil.

func (*ModelCreate) SetNillableCacheReadCost

func (mc *ModelCreate) SetNillableCacheReadCost(f *float64) *ModelCreate

SetNillableCacheReadCost sets the "cache_read_cost" field if the given value is not nil.

func (*ModelCreate) SetNillableCacheWriteCost

func (mc *ModelCreate) SetNillableCacheWriteCost(f *float64) *ModelCreate

SetNillableCacheWriteCost sets the "cache_write_cost" field if the given value is not nil.

func (*ModelCreate) SetNillableCreateTime

func (mc *ModelCreate) SetNillableCreateTime(t *time.Time) *ModelCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ModelCreate) SetNillableEnabled

func (mc *ModelCreate) SetNillableEnabled(b *bool) *ModelCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ModelCreate) SetNillableID

func (mc *ModelCreate) SetNillableID(u *uuid.UUID) *ModelCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ModelCreate) SetNillableInputCost

func (mc *ModelCreate) SetNillableInputCost(f *float64) *ModelCreate

SetNillableInputCost sets the "input_cost" field if the given value is not nil.

func (*ModelCreate) SetNillableOutputCost

func (mc *ModelCreate) SetNillableOutputCost(f *float64) *ModelCreate

SetNillableOutputCost sets the "output_cost" field if the given value is not nil.

func (*ModelCreate) SetNillableUpdateTime

func (mc *ModelCreate) SetNillableUpdateTime(t *time.Time) *ModelCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ModelCreate) SetOutputCost

func (mc *ModelCreate) SetOutputCost(f float64) *ModelCreate

SetOutputCost sets the "output_cost" field.

func (*ModelCreate) SetUpdateTime

func (mc *ModelCreate) SetUpdateTime(t time.Time) *ModelCreate

SetUpdateTime sets the "update_time" field.

type ModelCreateBulk

type ModelCreateBulk struct {
	// contains filtered or unexported fields
}

ModelCreateBulk is the builder for creating many Model entities in bulk.

func (*ModelCreateBulk) Exec

func (mcb *ModelCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelCreateBulk) ExecX

func (mcb *ModelCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelCreateBulk) Save

func (mcb *ModelCreateBulk) Save(ctx context.Context) ([]*Model, error)

Save creates the Model entities in the database.

func (*ModelCreateBulk) SaveX

func (mcb *ModelCreateBulk) SaveX(ctx context.Context) []*Model

SaveX is like Save, but panics if an error occurs.

type ModelDelete

type ModelDelete struct {
	// contains filtered or unexported fields
}

ModelDelete is the builder for deleting a Model entity.

func (*ModelDelete) Exec

func (md *ModelDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ModelDelete) ExecX

func (md *ModelDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ModelDelete) Where

func (md *ModelDelete) Where(ps ...predicate.Model) *ModelDelete

Where appends a list predicates to the ModelDelete builder.

type ModelDeleteOne

type ModelDeleteOne struct {
	// contains filtered or unexported fields
}

ModelDeleteOne is the builder for deleting a single Model entity.

func (*ModelDeleteOne) Exec

func (mdo *ModelDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ModelDeleteOne) ExecX

func (mdo *ModelDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelDeleteOne) Where

func (mdo *ModelDeleteOne) Where(ps ...predicate.Model) *ModelDeleteOne

Where appends a list predicates to the ModelDelete builder.

type ModelEdges

type ModelEdges struct {
	// Agents holds the value of the agents edge.
	Agents []*Agent `json:"agents,omitempty"`
	// ModelProvider holds the value of the model_provider edge.
	ModelProvider *ModelProvider `json:"model_provider,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

ModelEdges holds the relations/edges for other nodes in the graph.

func (ModelEdges) AgentsOrErr

func (e ModelEdges) AgentsOrErr() ([]*Agent, error)

AgentsOrErr returns the Agents value or an error if the edge was not loaded in eager-loading.

func (ModelEdges) MessagesOrErr

func (e ModelEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

func (ModelEdges) ModelProviderOrErr

func (e ModelEdges) ModelProviderOrErr() (*ModelProvider, error)

ModelProviderOrErr returns the ModelProvider value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ModelGroupBy

type ModelGroupBy struct {
	// contains filtered or unexported fields
}

ModelGroupBy is the group-by builder for Model entities.

func (*ModelGroupBy) Aggregate

func (mgb *ModelGroupBy) Aggregate(fns ...AggregateFunc) *ModelGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ModelGroupBy) Bool

func (s *ModelGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) BoolX

func (s *ModelGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ModelGroupBy) Bools

func (s *ModelGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) BoolsX

func (s *ModelGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ModelGroupBy) Float64

func (s *ModelGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) Float64X

func (s *ModelGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ModelGroupBy) Float64s

func (s *ModelGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) Float64sX

func (s *ModelGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ModelGroupBy) Int

func (s *ModelGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) IntX

func (s *ModelGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ModelGroupBy) Ints

func (s *ModelGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) IntsX

func (s *ModelGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ModelGroupBy) Scan

func (mgb *ModelGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ModelGroupBy) ScanX

func (s *ModelGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ModelGroupBy) String

func (s *ModelGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) StringX

func (s *ModelGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ModelGroupBy) Strings

func (s *ModelGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ModelGroupBy) StringsX

func (s *ModelGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ModelMutation

type ModelMutation struct {
	// contains filtered or unexported fields
}

ModelMutation represents an operation that mutates the Model nodes in the graph.

func (*ModelMutation) AddAgentIDs

func (m *ModelMutation) AddAgentIDs(ids ...uuid.UUID)

AddAgentIDs adds the "agents" edge to the Agent entity by ids.

func (*ModelMutation) AddCacheReadCost

func (m *ModelMutation) AddCacheReadCost(f float64)

AddCacheReadCost adds f to the "cache_read_cost" field.

func (*ModelMutation) AddCacheWriteCost

func (m *ModelMutation) AddCacheWriteCost(f float64)

AddCacheWriteCost adds f to the "cache_write_cost" field.

func (*ModelMutation) AddContextWindow

func (m *ModelMutation) AddContextWindow(i int64)

AddContextWindow adds i to the "context_window" field.

func (*ModelMutation) AddField

func (m *ModelMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ModelMutation) AddInputCost

func (m *ModelMutation) AddInputCost(f float64)

AddInputCost adds f to the "input_cost" field.

func (*ModelMutation) AddMessageIDs

func (m *ModelMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*ModelMutation) AddOutputCost

func (m *ModelMutation) AddOutputCost(f float64)

AddOutputCost adds f to the "output_cost" field.

func (*ModelMutation) AddedCacheReadCost

func (m *ModelMutation) AddedCacheReadCost() (r float64, exists bool)

AddedCacheReadCost returns the value that was added to the "cache_read_cost" field in this mutation.

func (*ModelMutation) AddedCacheWriteCost

func (m *ModelMutation) AddedCacheWriteCost() (r float64, exists bool)

AddedCacheWriteCost returns the value that was added to the "cache_write_cost" field in this mutation.

func (*ModelMutation) AddedContextWindow

func (m *ModelMutation) AddedContextWindow() (r int64, exists bool)

AddedContextWindow returns the value that was added to the "context_window" field in this mutation.

func (*ModelMutation) AddedEdges

func (m *ModelMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ModelMutation) AddedField

func (m *ModelMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ModelMutation) AddedFields

func (m *ModelMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ModelMutation) AddedIDs

func (m *ModelMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ModelMutation) AddedInputCost

func (m *ModelMutation) AddedInputCost() (r float64, exists bool)

AddedInputCost returns the value that was added to the "input_cost" field in this mutation.

func (*ModelMutation) AddedOutputCost

func (m *ModelMutation) AddedOutputCost() (r float64, exists bool)

AddedOutputCost returns the value that was added to the "output_cost" field in this mutation.

func (*ModelMutation) AgentsCleared

func (m *ModelMutation) AgentsCleared() bool

AgentsCleared reports if the "agents" edge to the Agent entity was cleared.

func (*ModelMutation) AgentsIDs

func (m *ModelMutation) AgentsIDs() (ids []uuid.UUID)

AgentsIDs returns the "agents" edge IDs in the mutation.

func (*ModelMutation) Alias

func (m *ModelMutation) Alias() (r string, exists bool)

Alias returns the value of the "alias" field in the mutation.

func (*ModelMutation) AliasCleared

func (m *ModelMutation) AliasCleared() bool

AliasCleared returns if the "alias" field was cleared in this mutation.

func (*ModelMutation) AppendCapabilities

func (m *ModelMutation) AppendCapabilities(tc []types.ModelCapability)

AppendCapabilities adds tc to the "capabilities" field.

func (*ModelMutation) AppendedCapabilities

func (m *ModelMutation) AppendedCapabilities() ([]types.ModelCapability, bool)

AppendedCapabilities returns the list of values that were appended to the "capabilities" field in this mutation.

func (*ModelMutation) CacheReadCost

func (m *ModelMutation) CacheReadCost() (r float64, exists bool)

CacheReadCost returns the value of the "cache_read_cost" field in the mutation.

func (*ModelMutation) CacheWriteCost

func (m *ModelMutation) CacheWriteCost() (r float64, exists bool)

CacheWriteCost returns the value of the "cache_write_cost" field in the mutation.

func (*ModelMutation) Capabilities

func (m *ModelMutation) Capabilities() (r []types.ModelCapability, exists bool)

Capabilities returns the value of the "capabilities" field in the mutation.

func (*ModelMutation) CapabilitiesCleared

func (m *ModelMutation) CapabilitiesCleared() bool

CapabilitiesCleared returns if the "capabilities" field was cleared in this mutation.

func (*ModelMutation) ClearAgents

func (m *ModelMutation) ClearAgents()

ClearAgents clears the "agents" edge to the Agent entity.

func (*ModelMutation) ClearAlias

func (m *ModelMutation) ClearAlias()

ClearAlias clears the value of the "alias" field.

func (*ModelMutation) ClearCapabilities

func (m *ModelMutation) ClearCapabilities()

ClearCapabilities clears the value of the "capabilities" field.

func (*ModelMutation) ClearEdge

func (m *ModelMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ModelMutation) ClearField

func (m *ModelMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ModelMutation) ClearMessages

func (m *ModelMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*ModelMutation) ClearModelProvider

func (m *ModelMutation) ClearModelProvider()

ClearModelProvider clears the "model_provider" edge to the ModelProvider entity.

func (*ModelMutation) ClearedEdges

func (m *ModelMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ModelMutation) ClearedFields

func (m *ModelMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ModelMutation) Client

func (m ModelMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ModelMutation) ContextWindow

func (m *ModelMutation) ContextWindow() (r int64, exists bool)

ContextWindow returns the value of the "context_window" field in the mutation.

func (*ModelMutation) CreateTime

func (m *ModelMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ModelMutation) EdgeCleared

func (m *ModelMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ModelMutation) Enabled

func (m *ModelMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*ModelMutation) Field

func (m *ModelMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ModelMutation) FieldCleared

func (m *ModelMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ModelMutation) Fields

func (m *ModelMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ModelMutation) ID

func (m *ModelMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ModelMutation) IDs

func (m *ModelMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ModelMutation) InputCost

func (m *ModelMutation) InputCost() (r float64, exists bool)

InputCost returns the value of the "input_cost" field in the mutation.

func (*ModelMutation) MessagesCleared

func (m *ModelMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*ModelMutation) MessagesIDs

func (m *ModelMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*ModelMutation) ModelProviderCleared

func (m *ModelMutation) ModelProviderCleared() bool

ModelProviderCleared reports if the "model_provider" edge to the ModelProvider entity was cleared.

func (*ModelMutation) ModelProviderID

func (m *ModelMutation) ModelProviderID() (r uuid.UUID, exists bool)

ModelProviderID returns the value of the "model_provider_id" field in the mutation.

func (*ModelMutation) ModelProviderIDs

func (m *ModelMutation) ModelProviderIDs() (ids []uuid.UUID)

ModelProviderIDs returns the "model_provider" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ModelProviderID instead. It exists only for internal usage by the builders.

func (*ModelMutation) Name

func (m *ModelMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ModelMutation) OldAlias

func (m *ModelMutation) OldAlias(ctx context.Context) (v string, err error)

OldAlias returns the old "alias" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldCacheReadCost

func (m *ModelMutation) OldCacheReadCost(ctx context.Context) (v float64, err error)

OldCacheReadCost returns the old "cache_read_cost" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldCacheWriteCost

func (m *ModelMutation) OldCacheWriteCost(ctx context.Context) (v float64, err error)

OldCacheWriteCost returns the old "cache_write_cost" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldCapabilities

func (m *ModelMutation) OldCapabilities(ctx context.Context) (v []types.ModelCapability, err error)

OldCapabilities returns the old "capabilities" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldContextWindow

func (m *ModelMutation) OldContextWindow(ctx context.Context) (v int64, err error)

OldContextWindow returns the old "context_window" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldCreateTime

func (m *ModelMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldEnabled

func (m *ModelMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldField

func (m *ModelMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ModelMutation) OldInputCost

func (m *ModelMutation) OldInputCost(ctx context.Context) (v float64, err error)

OldInputCost returns the old "input_cost" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldModelProviderID

func (m *ModelMutation) OldModelProviderID(ctx context.Context) (v uuid.UUID, err error)

OldModelProviderID returns the old "model_provider_id" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldName

func (m *ModelMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldOutputCost

func (m *ModelMutation) OldOutputCost(ctx context.Context) (v float64, err error)

OldOutputCost returns the old "output_cost" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) OldUpdateTime

func (m *ModelMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Model entity. If the Model object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelMutation) Op

func (m *ModelMutation) Op() Op

Op returns the operation name.

func (*ModelMutation) OutputCost

func (m *ModelMutation) OutputCost() (r float64, exists bool)

OutputCost returns the value of the "output_cost" field in the mutation.

func (*ModelMutation) RemoveAgentIDs

func (m *ModelMutation) RemoveAgentIDs(ids ...uuid.UUID)

RemoveAgentIDs removes the "agents" edge to the Agent entity by IDs.

func (*ModelMutation) RemoveMessageIDs

func (m *ModelMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*ModelMutation) RemovedAgentsIDs

func (m *ModelMutation) RemovedAgentsIDs() (ids []uuid.UUID)

RemovedAgents returns the removed IDs of the "agents" edge to the Agent entity.

func (*ModelMutation) RemovedEdges

func (m *ModelMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ModelMutation) RemovedIDs

func (m *ModelMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ModelMutation) RemovedMessagesIDs

func (m *ModelMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*ModelMutation) ResetAgents

func (m *ModelMutation) ResetAgents()

ResetAgents resets all changes to the "agents" edge.

func (*ModelMutation) ResetAlias

func (m *ModelMutation) ResetAlias()

ResetAlias resets all changes to the "alias" field.

func (*ModelMutation) ResetCacheReadCost

func (m *ModelMutation) ResetCacheReadCost()

ResetCacheReadCost resets all changes to the "cache_read_cost" field.

func (*ModelMutation) ResetCacheWriteCost

func (m *ModelMutation) ResetCacheWriteCost()

ResetCacheWriteCost resets all changes to the "cache_write_cost" field.

func (*ModelMutation) ResetCapabilities

func (m *ModelMutation) ResetCapabilities()

ResetCapabilities resets all changes to the "capabilities" field.

func (*ModelMutation) ResetContextWindow

func (m *ModelMutation) ResetContextWindow()

ResetContextWindow resets all changes to the "context_window" field.

func (*ModelMutation) ResetCreateTime

func (m *ModelMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ModelMutation) ResetEdge

func (m *ModelMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ModelMutation) ResetEnabled

func (m *ModelMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*ModelMutation) ResetField

func (m *ModelMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ModelMutation) ResetInputCost

func (m *ModelMutation) ResetInputCost()

ResetInputCost resets all changes to the "input_cost" field.

func (*ModelMutation) ResetMessages

func (m *ModelMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*ModelMutation) ResetModelProvider

func (m *ModelMutation) ResetModelProvider()

ResetModelProvider resets all changes to the "model_provider" edge.

func (*ModelMutation) ResetModelProviderID

func (m *ModelMutation) ResetModelProviderID()

ResetModelProviderID resets all changes to the "model_provider_id" field.

func (*ModelMutation) ResetName

func (m *ModelMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ModelMutation) ResetOutputCost

func (m *ModelMutation) ResetOutputCost()

ResetOutputCost resets all changes to the "output_cost" field.

func (*ModelMutation) ResetUpdateTime

func (m *ModelMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ModelMutation) SetAlias

func (m *ModelMutation) SetAlias(s string)

SetAlias sets the "alias" field.

func (*ModelMutation) SetCacheReadCost

func (m *ModelMutation) SetCacheReadCost(f float64)

SetCacheReadCost sets the "cache_read_cost" field.

func (*ModelMutation) SetCacheWriteCost

func (m *ModelMutation) SetCacheWriteCost(f float64)

SetCacheWriteCost sets the "cache_write_cost" field.

func (*ModelMutation) SetCapabilities

func (m *ModelMutation) SetCapabilities(tc []types.ModelCapability)

SetCapabilities sets the "capabilities" field.

func (*ModelMutation) SetContextWindow

func (m *ModelMutation) SetContextWindow(i int64)

SetContextWindow sets the "context_window" field.

func (*ModelMutation) SetCreateTime

func (m *ModelMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ModelMutation) SetEnabled

func (m *ModelMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*ModelMutation) SetField

func (m *ModelMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ModelMutation) SetID

func (m *ModelMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Model entities.

func (*ModelMutation) SetInputCost

func (m *ModelMutation) SetInputCost(f float64)

SetInputCost sets the "input_cost" field.

func (*ModelMutation) SetModelProviderID

func (m *ModelMutation) SetModelProviderID(u uuid.UUID)

SetModelProviderID sets the "model_provider_id" field.

func (*ModelMutation) SetName

func (m *ModelMutation) SetName(s string)

SetName sets the "name" field.

func (*ModelMutation) SetOp

func (m *ModelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ModelMutation) SetOutputCost

func (m *ModelMutation) SetOutputCost(f float64)

SetOutputCost sets the "output_cost" field.

func (*ModelMutation) SetUpdateTime

func (m *ModelMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (ModelMutation) Tx

func (m ModelMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ModelMutation) Type

func (m *ModelMutation) Type() string

Type returns the node type of this mutation (Model).

func (*ModelMutation) UpdateTime

func (m *ModelMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ModelMutation) Where

func (m *ModelMutation) Where(ps ...predicate.Model)

Where appends a list predicates to the ModelMutation builder.

func (*ModelMutation) WhereP

func (m *ModelMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ModelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ModelProvider

type ModelProvider struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// ProviderType holds the value of the "provider_type" field.
	ProviderType types.ModelProviderType `json:"provider_type,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Secret holds the value of the "secret" field.
	Secret []byte `json:"-"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ModelProviderQuery when eager-loading is set.
	Edges ModelProviderEdges `json:"edges"`
	// contains filtered or unexported fields
}

ModelProvider is the model entity for the ModelProvider schema.

func (*ModelProvider) QueryModels

func (mp *ModelProvider) QueryModels() *ModelQuery

QueryModels queries the "models" edge of the ModelProvider entity.

func (*ModelProvider) String

func (mp *ModelProvider) String() string

String implements the fmt.Stringer.

func (*ModelProvider) Unwrap

func (mp *ModelProvider) Unwrap() *ModelProvider

Unwrap unwraps the ModelProvider entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ModelProvider) Update

func (mp *ModelProvider) Update() *ModelProviderUpdateOne

Update returns a builder for updating this ModelProvider. Note that you need to call ModelProvider.Unwrap() before calling this method if this ModelProvider was returned from a transaction, and the transaction was committed or rolled back.

func (*ModelProvider) Value

func (mp *ModelProvider) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ModelProvider. This includes values selected through modifiers, order, etc.

type ModelProviderClient

type ModelProviderClient struct {
	// contains filtered or unexported fields
}

ModelProviderClient is a client for the ModelProvider schema.

func NewModelProviderClient

func NewModelProviderClient(c config) *ModelProviderClient

NewModelProviderClient returns a client for the ModelProvider from the given config.

func (*ModelProviderClient) Create

Create returns a builder for creating a ModelProvider entity.

func (*ModelProviderClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ModelProvider entities.

func (*ModelProviderClient) Delete

Delete returns a delete builder for ModelProvider.

func (*ModelProviderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ModelProviderClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ModelProviderClient) Get

Get returns a ModelProvider entity by its id.

func (*ModelProviderClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ModelProviderClient) Hooks

func (c *ModelProviderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ModelProviderClient) Intercept

func (c *ModelProviderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `modelprovider.Intercept(f(g(h())))`.

func (*ModelProviderClient) Interceptors

func (c *ModelProviderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ModelProviderClient) MapCreateBulk

func (c *ModelProviderClient) MapCreateBulk(slice any, setFunc func(*ModelProviderCreate, int)) *ModelProviderCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ModelProviderClient) Query

Query returns a query builder for ModelProvider.

func (*ModelProviderClient) QueryModels

func (c *ModelProviderClient) QueryModels(mp *ModelProvider) *ModelQuery

QueryModels queries the models edge of a ModelProvider.

func (*ModelProviderClient) Update

Update returns an update builder for ModelProvider.

func (*ModelProviderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ModelProviderClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ModelProviderClient) Use

func (c *ModelProviderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `modelprovider.Hooks(f(g(h())))`.

type ModelProviderCreate

type ModelProviderCreate struct {
	// contains filtered or unexported fields
}

ModelProviderCreate is the builder for creating a ModelProvider entity.

func (*ModelProviderCreate) AddModelIDs

func (mpc *ModelProviderCreate) AddModelIDs(ids ...uuid.UUID) *ModelProviderCreate

AddModelIDs adds the "models" edge to the Model entity by IDs.

func (*ModelProviderCreate) AddModels

func (mpc *ModelProviderCreate) AddModels(m ...*Model) *ModelProviderCreate

AddModels adds the "models" edges to the Model entity.

func (*ModelProviderCreate) Exec

func (mpc *ModelProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelProviderCreate) ExecX

func (mpc *ModelProviderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelProviderCreate) Mutation

func (mpc *ModelProviderCreate) Mutation() *ModelProviderMutation

Mutation returns the ModelProviderMutation object of the builder.

func (*ModelProviderCreate) Save

Save creates the ModelProvider in the database.

func (*ModelProviderCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ModelProviderCreate) SetCreateTime

func (mpc *ModelProviderCreate) SetCreateTime(t time.Time) *ModelProviderCreate

SetCreateTime sets the "create_time" field.

func (*ModelProviderCreate) SetEnabled

func (mpc *ModelProviderCreate) SetEnabled(b bool) *ModelProviderCreate

SetEnabled sets the "enabled" field.

func (*ModelProviderCreate) SetID

SetID sets the "id" field.

func (*ModelProviderCreate) SetName

SetName sets the "name" field.

func (*ModelProviderCreate) SetNillableCreateTime

func (mpc *ModelProviderCreate) SetNillableCreateTime(t *time.Time) *ModelProviderCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ModelProviderCreate) SetNillableEnabled

func (mpc *ModelProviderCreate) SetNillableEnabled(b *bool) *ModelProviderCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ModelProviderCreate) SetNillableID

func (mpc *ModelProviderCreate) SetNillableID(u *uuid.UUID) *ModelProviderCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ModelProviderCreate) SetNillableURL

func (mpc *ModelProviderCreate) SetNillableURL(s *string) *ModelProviderCreate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ModelProviderCreate) SetNillableUpdateTime

func (mpc *ModelProviderCreate) SetNillableUpdateTime(t *time.Time) *ModelProviderCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ModelProviderCreate) SetProviderType

SetProviderType sets the "provider_type" field.

func (*ModelProviderCreate) SetSecret

func (mpc *ModelProviderCreate) SetSecret(b []byte) *ModelProviderCreate

SetSecret sets the "secret" field.

func (*ModelProviderCreate) SetURL

SetURL sets the "url" field.

func (*ModelProviderCreate) SetUpdateTime

func (mpc *ModelProviderCreate) SetUpdateTime(t time.Time) *ModelProviderCreate

SetUpdateTime sets the "update_time" field.

type ModelProviderCreateBulk

type ModelProviderCreateBulk struct {
	// contains filtered or unexported fields
}

ModelProviderCreateBulk is the builder for creating many ModelProvider entities in bulk.

func (*ModelProviderCreateBulk) Exec

func (mpcb *ModelProviderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelProviderCreateBulk) ExecX

func (mpcb *ModelProviderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelProviderCreateBulk) Save

Save creates the ModelProvider entities in the database.

func (*ModelProviderCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ModelProviderDelete

type ModelProviderDelete struct {
	// contains filtered or unexported fields
}

ModelProviderDelete is the builder for deleting a ModelProvider entity.

func (*ModelProviderDelete) Exec

func (mpd *ModelProviderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ModelProviderDelete) ExecX

func (mpd *ModelProviderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ModelProviderDelete) Where

Where appends a list predicates to the ModelProviderDelete builder.

type ModelProviderDeleteOne

type ModelProviderDeleteOne struct {
	// contains filtered or unexported fields
}

ModelProviderDeleteOne is the builder for deleting a single ModelProvider entity.

func (*ModelProviderDeleteOne) Exec

func (mpdo *ModelProviderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ModelProviderDeleteOne) ExecX

func (mpdo *ModelProviderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelProviderDeleteOne) Where

Where appends a list predicates to the ModelProviderDelete builder.

type ModelProviderEdges

type ModelProviderEdges struct {
	// Models holds the value of the models edge.
	Models []*Model `json:"models,omitempty"`
	// contains filtered or unexported fields
}

ModelProviderEdges holds the relations/edges for other nodes in the graph.

func (ModelProviderEdges) ModelsOrErr

func (e ModelProviderEdges) ModelsOrErr() ([]*Model, error)

ModelsOrErr returns the Models value or an error if the edge was not loaded in eager-loading.

type ModelProviderGroupBy

type ModelProviderGroupBy struct {
	// contains filtered or unexported fields
}

ModelProviderGroupBy is the group-by builder for ModelProvider entities.

func (*ModelProviderGroupBy) Aggregate

func (mpgb *ModelProviderGroupBy) Aggregate(fns ...AggregateFunc) *ModelProviderGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ModelProviderGroupBy) Bool

func (s *ModelProviderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) BoolX

func (s *ModelProviderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ModelProviderGroupBy) Bools

func (s *ModelProviderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) BoolsX

func (s *ModelProviderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ModelProviderGroupBy) Float64

func (s *ModelProviderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) Float64X

func (s *ModelProviderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ModelProviderGroupBy) Float64s

func (s *ModelProviderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) Float64sX

func (s *ModelProviderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ModelProviderGroupBy) Int

func (s *ModelProviderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) IntX

func (s *ModelProviderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ModelProviderGroupBy) Ints

func (s *ModelProviderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) IntsX

func (s *ModelProviderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ModelProviderGroupBy) Scan

func (mpgb *ModelProviderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ModelProviderGroupBy) ScanX

func (s *ModelProviderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ModelProviderGroupBy) String

func (s *ModelProviderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) StringX

func (s *ModelProviderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ModelProviderGroupBy) Strings

func (s *ModelProviderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ModelProviderGroupBy) StringsX

func (s *ModelProviderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ModelProviderMutation

type ModelProviderMutation struct {
	// contains filtered or unexported fields
}

ModelProviderMutation represents an operation that mutates the ModelProvider nodes in the graph.

func (*ModelProviderMutation) AddField

func (m *ModelProviderMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ModelProviderMutation) AddModelIDs

func (m *ModelProviderMutation) AddModelIDs(ids ...uuid.UUID)

AddModelIDs adds the "models" edge to the Model entity by ids.

func (*ModelProviderMutation) AddedEdges

func (m *ModelProviderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ModelProviderMutation) AddedField

func (m *ModelProviderMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ModelProviderMutation) AddedFields

func (m *ModelProviderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ModelProviderMutation) AddedIDs

func (m *ModelProviderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ModelProviderMutation) ClearEdge

func (m *ModelProviderMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ModelProviderMutation) ClearField

func (m *ModelProviderMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ModelProviderMutation) ClearModels

func (m *ModelProviderMutation) ClearModels()

ClearModels clears the "models" edge to the Model entity.

func (*ModelProviderMutation) ClearURL

func (m *ModelProviderMutation) ClearURL()

ClearURL clears the value of the "url" field.

func (*ModelProviderMutation) ClearedEdges

func (m *ModelProviderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ModelProviderMutation) ClearedFields

func (m *ModelProviderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ModelProviderMutation) Client

func (m ModelProviderMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ModelProviderMutation) CreateTime

func (m *ModelProviderMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ModelProviderMutation) EdgeCleared

func (m *ModelProviderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ModelProviderMutation) Enabled

func (m *ModelProviderMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*ModelProviderMutation) Field

func (m *ModelProviderMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ModelProviderMutation) FieldCleared

func (m *ModelProviderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ModelProviderMutation) Fields

func (m *ModelProviderMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ModelProviderMutation) ID

func (m *ModelProviderMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ModelProviderMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ModelProviderMutation) ModelsCleared

func (m *ModelProviderMutation) ModelsCleared() bool

ModelsCleared reports if the "models" edge to the Model entity was cleared.

func (*ModelProviderMutation) ModelsIDs

func (m *ModelProviderMutation) ModelsIDs() (ids []uuid.UUID)

ModelsIDs returns the "models" edge IDs in the mutation.

func (*ModelProviderMutation) Name

func (m *ModelProviderMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ModelProviderMutation) OldCreateTime

func (m *ModelProviderMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) OldEnabled

func (m *ModelProviderMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) OldField

func (m *ModelProviderMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ModelProviderMutation) OldName

func (m *ModelProviderMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) OldProviderType

func (m *ModelProviderMutation) OldProviderType(ctx context.Context) (v types.ModelProviderType, err error)

OldProviderType returns the old "provider_type" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) OldSecret

func (m *ModelProviderMutation) OldSecret(ctx context.Context) (v []byte, err error)

OldSecret returns the old "secret" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) OldURL

func (m *ModelProviderMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) OldUpdateTime

func (m *ModelProviderMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the ModelProvider entity. If the ModelProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ModelProviderMutation) Op

func (m *ModelProviderMutation) Op() Op

Op returns the operation name.

func (*ModelProviderMutation) ProviderType

func (m *ModelProviderMutation) ProviderType() (r types.ModelProviderType, exists bool)

ProviderType returns the value of the "provider_type" field in the mutation.

func (*ModelProviderMutation) RemoveModelIDs

func (m *ModelProviderMutation) RemoveModelIDs(ids ...uuid.UUID)

RemoveModelIDs removes the "models" edge to the Model entity by IDs.

func (*ModelProviderMutation) RemovedEdges

func (m *ModelProviderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ModelProviderMutation) RemovedIDs

func (m *ModelProviderMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ModelProviderMutation) RemovedModelsIDs

func (m *ModelProviderMutation) RemovedModelsIDs() (ids []uuid.UUID)

RemovedModels returns the removed IDs of the "models" edge to the Model entity.

func (*ModelProviderMutation) ResetCreateTime

func (m *ModelProviderMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ModelProviderMutation) ResetEdge

func (m *ModelProviderMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ModelProviderMutation) ResetEnabled

func (m *ModelProviderMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*ModelProviderMutation) ResetField

func (m *ModelProviderMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ModelProviderMutation) ResetModels

func (m *ModelProviderMutation) ResetModels()

ResetModels resets all changes to the "models" edge.

func (*ModelProviderMutation) ResetName

func (m *ModelProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ModelProviderMutation) ResetProviderType

func (m *ModelProviderMutation) ResetProviderType()

ResetProviderType resets all changes to the "provider_type" field.

func (*ModelProviderMutation) ResetSecret

func (m *ModelProviderMutation) ResetSecret()

ResetSecret resets all changes to the "secret" field.

func (*ModelProviderMutation) ResetURL

func (m *ModelProviderMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ModelProviderMutation) ResetUpdateTime

func (m *ModelProviderMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ModelProviderMutation) Secret

func (m *ModelProviderMutation) Secret() (r []byte, exists bool)

Secret returns the value of the "secret" field in the mutation.

func (*ModelProviderMutation) SetCreateTime

func (m *ModelProviderMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ModelProviderMutation) SetEnabled

func (m *ModelProviderMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*ModelProviderMutation) SetField

func (m *ModelProviderMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ModelProviderMutation) SetID

func (m *ModelProviderMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ModelProvider entities.

func (*ModelProviderMutation) SetName

func (m *ModelProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*ModelProviderMutation) SetOp

func (m *ModelProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ModelProviderMutation) SetProviderType

func (m *ModelProviderMutation) SetProviderType(tpt types.ModelProviderType)

SetProviderType sets the "provider_type" field.

func (*ModelProviderMutation) SetSecret

func (m *ModelProviderMutation) SetSecret(b []byte)

SetSecret sets the "secret" field.

func (*ModelProviderMutation) SetURL

func (m *ModelProviderMutation) SetURL(s string)

SetURL sets the "url" field.

func (*ModelProviderMutation) SetUpdateTime

func (m *ModelProviderMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (ModelProviderMutation) Tx

func (m ModelProviderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ModelProviderMutation) Type

func (m *ModelProviderMutation) Type() string

Type returns the node type of this mutation (ModelProvider).

func (*ModelProviderMutation) URL

func (m *ModelProviderMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*ModelProviderMutation) URLCleared

func (m *ModelProviderMutation) URLCleared() bool

URLCleared returns if the "url" field was cleared in this mutation.

func (*ModelProviderMutation) UpdateTime

func (m *ModelProviderMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ModelProviderMutation) Where

Where appends a list predicates to the ModelProviderMutation builder.

func (*ModelProviderMutation) WhereP

func (m *ModelProviderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ModelProviderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ModelProviderQuery

type ModelProviderQuery struct {
	// contains filtered or unexported fields
}

ModelProviderQuery is the builder for querying ModelProvider entities.

func (*ModelProviderQuery) Aggregate

func (mpq *ModelProviderQuery) Aggregate(fns ...AggregateFunc) *ModelProviderSelect

Aggregate returns a ModelProviderSelect configured with the given aggregations.

func (*ModelProviderQuery) All

All executes the query and returns a list of ModelProviders.

func (*ModelProviderQuery) AllX

func (mpq *ModelProviderQuery) AllX(ctx context.Context) []*ModelProvider

AllX is like All, but panics if an error occurs.

func (*ModelProviderQuery) Clone

func (mpq *ModelProviderQuery) Clone() *ModelProviderQuery

Clone returns a duplicate of the ModelProviderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ModelProviderQuery) Count

func (mpq *ModelProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ModelProviderQuery) CountX

func (mpq *ModelProviderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ModelProviderQuery) Exist

func (mpq *ModelProviderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ModelProviderQuery) ExistX

func (mpq *ModelProviderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ModelProviderQuery) First

First returns the first ModelProvider entity from the query. Returns a *NotFoundError when no ModelProvider was found.

func (*ModelProviderQuery) FirstID

func (mpq *ModelProviderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ModelProvider ID from the query. Returns a *NotFoundError when no ModelProvider ID was found.

func (*ModelProviderQuery) FirstIDX

func (mpq *ModelProviderQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ModelProviderQuery) FirstX

func (mpq *ModelProviderQuery) FirstX(ctx context.Context) *ModelProvider

FirstX is like First, but panics if an error occurs.

func (*ModelProviderQuery) GroupBy

func (mpq *ModelProviderQuery) GroupBy(field string, fields ...string) *ModelProviderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ModelProvider.Query().
	GroupBy(modelprovider.FieldCreateTime).
	Aggregate(memory.Count()).
	Scan(ctx, &v)

func (*ModelProviderQuery) IDs

func (mpq *ModelProviderQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ModelProvider IDs.

func (*ModelProviderQuery) IDsX

func (mpq *ModelProviderQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ModelProviderQuery) Limit

func (mpq *ModelProviderQuery) Limit(limit int) *ModelProviderQuery

Limit the number of records to be returned by this query.

func (*ModelProviderQuery) Modify

func (mpq *ModelProviderQuery) Modify(modifiers ...func(s *sql.Selector)) *ModelProviderSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ModelProviderQuery) Offset

func (mpq *ModelProviderQuery) Offset(offset int) *ModelProviderQuery

Offset to start from.

func (*ModelProviderQuery) Only

Only returns a single ModelProvider entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ModelProvider entity is found. Returns a *NotFoundError when no ModelProvider entities are found.

func (*ModelProviderQuery) OnlyID

func (mpq *ModelProviderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ModelProvider ID in the query. Returns a *NotSingularError when more than one ModelProvider ID is found. Returns a *NotFoundError when no entities are found.

func (*ModelProviderQuery) OnlyIDX

func (mpq *ModelProviderQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ModelProviderQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ModelProviderQuery) Order

Order specifies how the records should be ordered.

func (*ModelProviderQuery) QueryModels

func (mpq *ModelProviderQuery) QueryModels() *ModelQuery

QueryModels chains the current query on the "models" edge.

func (*ModelProviderQuery) Select

func (mpq *ModelProviderQuery) Select(fields ...string) *ModelProviderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.ModelProvider.Query().
	Select(modelprovider.FieldCreateTime).
	Scan(ctx, &v)

func (*ModelProviderQuery) Unique

func (mpq *ModelProviderQuery) Unique(unique bool) *ModelProviderQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ModelProviderQuery) Where

Where adds a new predicate for the ModelProviderQuery builder.

func (*ModelProviderQuery) WithModels

func (mpq *ModelProviderQuery) WithModels(opts ...func(*ModelQuery)) *ModelProviderQuery

WithModels tells the query-builder to eager-load the nodes that are connected to the "models" edge. The optional arguments are used to configure the query builder of the edge.

type ModelProviderSelect

type ModelProviderSelect struct {
	*ModelProviderQuery
	// contains filtered or unexported fields
}

ModelProviderSelect is the builder for selecting fields of ModelProvider entities.

func (*ModelProviderSelect) Aggregate

func (mps *ModelProviderSelect) Aggregate(fns ...AggregateFunc) *ModelProviderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ModelProviderSelect) Bool

func (s *ModelProviderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) BoolX

func (s *ModelProviderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ModelProviderSelect) Bools

func (s *ModelProviderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) BoolsX

func (s *ModelProviderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ModelProviderSelect) Float64

func (s *ModelProviderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) Float64X

func (s *ModelProviderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ModelProviderSelect) Float64s

func (s *ModelProviderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) Float64sX

func (s *ModelProviderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ModelProviderSelect) Int

func (s *ModelProviderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) IntX

func (s *ModelProviderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ModelProviderSelect) Ints

func (s *ModelProviderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) IntsX

func (s *ModelProviderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ModelProviderSelect) Modify

func (mps *ModelProviderSelect) Modify(modifiers ...func(s *sql.Selector)) *ModelProviderSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ModelProviderSelect) Scan

func (mps *ModelProviderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ModelProviderSelect) ScanX

func (s *ModelProviderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ModelProviderSelect) String

func (s *ModelProviderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) StringX

func (s *ModelProviderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ModelProviderSelect) Strings

func (s *ModelProviderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ModelProviderSelect) StringsX

func (s *ModelProviderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ModelProviderUpdate

type ModelProviderUpdate struct {
	// contains filtered or unexported fields
}

ModelProviderUpdate is the builder for updating ModelProvider entities.

func (*ModelProviderUpdate) AddModelIDs

func (mpu *ModelProviderUpdate) AddModelIDs(ids ...uuid.UUID) *ModelProviderUpdate

AddModelIDs adds the "models" edge to the Model entity by IDs.

func (*ModelProviderUpdate) AddModels

func (mpu *ModelProviderUpdate) AddModels(m ...*Model) *ModelProviderUpdate

AddModels adds the "models" edges to the Model entity.

func (*ModelProviderUpdate) ClearModels

func (mpu *ModelProviderUpdate) ClearModels() *ModelProviderUpdate

ClearModels clears all "models" edges to the Model entity.

func (*ModelProviderUpdate) ClearURL

func (mpu *ModelProviderUpdate) ClearURL() *ModelProviderUpdate

ClearURL clears the value of the "url" field.

func (*ModelProviderUpdate) Exec

func (mpu *ModelProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelProviderUpdate) ExecX

func (mpu *ModelProviderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelProviderUpdate) Modify

func (mpu *ModelProviderUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ModelProviderUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ModelProviderUpdate) Mutation

func (mpu *ModelProviderUpdate) Mutation() *ModelProviderMutation

Mutation returns the ModelProviderMutation object of the builder.

func (*ModelProviderUpdate) RemoveModelIDs

func (mpu *ModelProviderUpdate) RemoveModelIDs(ids ...uuid.UUID) *ModelProviderUpdate

RemoveModelIDs removes the "models" edge to Model entities by IDs.

func (*ModelProviderUpdate) RemoveModels

func (mpu *ModelProviderUpdate) RemoveModels(m ...*Model) *ModelProviderUpdate

RemoveModels removes "models" edges to Model entities.

func (*ModelProviderUpdate) Save

func (mpu *ModelProviderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ModelProviderUpdate) SaveX

func (mpu *ModelProviderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ModelProviderUpdate) SetEnabled

func (mpu *ModelProviderUpdate) SetEnabled(b bool) *ModelProviderUpdate

SetEnabled sets the "enabled" field.

func (*ModelProviderUpdate) SetName

SetName sets the "name" field.

func (*ModelProviderUpdate) SetNillableEnabled

func (mpu *ModelProviderUpdate) SetNillableEnabled(b *bool) *ModelProviderUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ModelProviderUpdate) SetNillableName

func (mpu *ModelProviderUpdate) SetNillableName(s *string) *ModelProviderUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ModelProviderUpdate) SetNillableProviderType

func (mpu *ModelProviderUpdate) SetNillableProviderType(tpt *types.ModelProviderType) *ModelProviderUpdate

SetNillableProviderType sets the "provider_type" field if the given value is not nil.

func (*ModelProviderUpdate) SetNillableURL

func (mpu *ModelProviderUpdate) SetNillableURL(s *string) *ModelProviderUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ModelProviderUpdate) SetProviderType

SetProviderType sets the "provider_type" field.

func (*ModelProviderUpdate) SetSecret

func (mpu *ModelProviderUpdate) SetSecret(b []byte) *ModelProviderUpdate

SetSecret sets the "secret" field.

func (*ModelProviderUpdate) SetURL

SetURL sets the "url" field.

func (*ModelProviderUpdate) SetUpdateTime

func (mpu *ModelProviderUpdate) SetUpdateTime(t time.Time) *ModelProviderUpdate

SetUpdateTime sets the "update_time" field.

func (*ModelProviderUpdate) Where

Where appends a list predicates to the ModelProviderUpdate builder.

type ModelProviderUpdateOne

type ModelProviderUpdateOne struct {
	// contains filtered or unexported fields
}

ModelProviderUpdateOne is the builder for updating a single ModelProvider entity.

func (*ModelProviderUpdateOne) AddModelIDs

func (mpuo *ModelProviderUpdateOne) AddModelIDs(ids ...uuid.UUID) *ModelProviderUpdateOne

AddModelIDs adds the "models" edge to the Model entity by IDs.

func (*ModelProviderUpdateOne) AddModels

func (mpuo *ModelProviderUpdateOne) AddModels(m ...*Model) *ModelProviderUpdateOne

AddModels adds the "models" edges to the Model entity.

func (*ModelProviderUpdateOne) ClearModels

func (mpuo *ModelProviderUpdateOne) ClearModels() *ModelProviderUpdateOne

ClearModels clears all "models" edges to the Model entity.

func (*ModelProviderUpdateOne) ClearURL

ClearURL clears the value of the "url" field.

func (*ModelProviderUpdateOne) Exec

func (mpuo *ModelProviderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ModelProviderUpdateOne) ExecX

func (mpuo *ModelProviderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelProviderUpdateOne) Modify

func (mpuo *ModelProviderUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ModelProviderUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ModelProviderUpdateOne) Mutation

Mutation returns the ModelProviderMutation object of the builder.

func (*ModelProviderUpdateOne) RemoveModelIDs

func (mpuo *ModelProviderUpdateOne) RemoveModelIDs(ids ...uuid.UUID) *ModelProviderUpdateOne

RemoveModelIDs removes the "models" edge to Model entities by IDs.

func (*ModelProviderUpdateOne) RemoveModels

func (mpuo *ModelProviderUpdateOne) RemoveModels(m ...*Model) *ModelProviderUpdateOne

RemoveModels removes "models" edges to Model entities.

func (*ModelProviderUpdateOne) Save

Save executes the query and returns the updated ModelProvider entity.

func (*ModelProviderUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ModelProviderUpdateOne) Select

func (mpuo *ModelProviderUpdateOne) Select(field string, fields ...string) *ModelProviderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ModelProviderUpdateOne) SetEnabled

func (mpuo *ModelProviderUpdateOne) SetEnabled(b bool) *ModelProviderUpdateOne

SetEnabled sets the "enabled" field.

func (*ModelProviderUpdateOne) SetName

SetName sets the "name" field.

func (*ModelProviderUpdateOne) SetNillableEnabled

func (mpuo *ModelProviderUpdateOne) SetNillableEnabled(b *bool) *ModelProviderUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ModelProviderUpdateOne) SetNillableName

func (mpuo *ModelProviderUpdateOne) SetNillableName(s *string) *ModelProviderUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ModelProviderUpdateOne) SetNillableProviderType

func (mpuo *ModelProviderUpdateOne) SetNillableProviderType(tpt *types.ModelProviderType) *ModelProviderUpdateOne

SetNillableProviderType sets the "provider_type" field if the given value is not nil.

func (*ModelProviderUpdateOne) SetNillableURL

func (mpuo *ModelProviderUpdateOne) SetNillableURL(s *string) *ModelProviderUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*ModelProviderUpdateOne) SetProviderType

SetProviderType sets the "provider_type" field.

func (*ModelProviderUpdateOne) SetSecret

func (mpuo *ModelProviderUpdateOne) SetSecret(b []byte) *ModelProviderUpdateOne

SetSecret sets the "secret" field.

func (*ModelProviderUpdateOne) SetURL

SetURL sets the "url" field.

func (*ModelProviderUpdateOne) SetUpdateTime

func (mpuo *ModelProviderUpdateOne) SetUpdateTime(t time.Time) *ModelProviderUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ModelProviderUpdateOne) Where

Where appends a list predicates to the ModelProviderUpdate builder.

type ModelProviders

type ModelProviders []*ModelProvider

ModelProviders is a parsable slice of ModelProvider.

type ModelQuery

type ModelQuery struct {
	// contains filtered or unexported fields
}

ModelQuery is the builder for querying Model entities.

func (*ModelQuery) Aggregate

func (mq *ModelQuery) Aggregate(fns ...AggregateFunc) *ModelSelect

Aggregate returns a ModelSelect configured with the given aggregations.

func (*ModelQuery) All

func (mq *ModelQuery) All(ctx context.Context) ([]*Model, error)

All executes the query and returns a list of Models.

func (*ModelQuery) AllX

func (mq *ModelQuery) AllX(ctx context.Context) []*Model

AllX is like All, but panics if an error occurs.

func (*ModelQuery) Clone

func (mq *ModelQuery) Clone() *ModelQuery

Clone returns a duplicate of the ModelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ModelQuery) Count

func (mq *ModelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ModelQuery) CountX

func (mq *ModelQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ModelQuery) Exist

func (mq *ModelQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ModelQuery) ExistX

func (mq *ModelQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ModelQuery) First

func (mq *ModelQuery) First(ctx context.Context) (*Model, error)

First returns the first Model entity from the query. Returns a *NotFoundError when no Model was found.

func (*ModelQuery) FirstID

func (mq *ModelQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Model ID from the query. Returns a *NotFoundError when no Model ID was found.

func (*ModelQuery) FirstIDX

func (mq *ModelQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ModelQuery) FirstX

func (mq *ModelQuery) FirstX(ctx context.Context) *Model

FirstX is like First, but panics if an error occurs.

func (*ModelQuery) GroupBy

func (mq *ModelQuery) GroupBy(field string, fields ...string) *ModelGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Model.Query().
	GroupBy(model.FieldCreateTime).
	Aggregate(memory.Count()).
	Scan(ctx, &v)

func (*ModelQuery) IDs

func (mq *ModelQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Model IDs.

func (*ModelQuery) IDsX

func (mq *ModelQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ModelQuery) Limit

func (mq *ModelQuery) Limit(limit int) *ModelQuery

Limit the number of records to be returned by this query.

func (*ModelQuery) Modify

func (mq *ModelQuery) Modify(modifiers ...func(s *sql.Selector)) *ModelSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ModelQuery) Offset

func (mq *ModelQuery) Offset(offset int) *ModelQuery

Offset to start from.

func (*ModelQuery) Only

func (mq *ModelQuery) Only(ctx context.Context) (*Model, error)

Only returns a single Model entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Model entity is found. Returns a *NotFoundError when no Model entities are found.

func (*ModelQuery) OnlyID

func (mq *ModelQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Model ID in the query. Returns a *NotSingularError when more than one Model ID is found. Returns a *NotFoundError when no entities are found.

func (*ModelQuery) OnlyIDX

func (mq *ModelQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ModelQuery) OnlyX

func (mq *ModelQuery) OnlyX(ctx context.Context) *Model

OnlyX is like Only, but panics if an error occurs.

func (*ModelQuery) Order

func (mq *ModelQuery) Order(o ...model.OrderOption) *ModelQuery

Order specifies how the records should be ordered.

func (*ModelQuery) QueryAgents

func (mq *ModelQuery) QueryAgents() *AgentQuery

QueryAgents chains the current query on the "agents" edge.

func (*ModelQuery) QueryMessages

func (mq *ModelQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*ModelQuery) QueryModelProvider

func (mq *ModelQuery) QueryModelProvider() *ModelProviderQuery

QueryModelProvider chains the current query on the "model_provider" edge.

func (*ModelQuery) Select

func (mq *ModelQuery) Select(fields ...string) *ModelSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Model.Query().
	Select(model.FieldCreateTime).
	Scan(ctx, &v)

func (*ModelQuery) Unique

func (mq *ModelQuery) Unique(unique bool) *ModelQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ModelQuery) Where

func (mq *ModelQuery) Where(ps ...predicate.Model) *ModelQuery

Where adds a new predicate for the ModelQuery builder.

func (*ModelQuery) WithAgents

func (mq *ModelQuery) WithAgents(opts ...func(*AgentQuery)) *ModelQuery

WithAgents tells the query-builder to eager-load the nodes that are connected to the "agents" edge. The optional arguments are used to configure the query builder of the edge.

func (*ModelQuery) WithMessages

func (mq *ModelQuery) WithMessages(opts ...func(*MessageQuery)) *ModelQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

func (*ModelQuery) WithModelProvider

func (mq *ModelQuery) WithModelProvider(opts ...func(*ModelProviderQuery)) *ModelQuery

WithModelProvider tells the query-builder to eager-load the nodes that are connected to the "model_provider" edge. The optional arguments are used to configure the query builder of the edge.

type ModelSelect

type ModelSelect struct {
	*ModelQuery
	// contains filtered or unexported fields
}

ModelSelect is the builder for selecting fields of Model entities.

func (*ModelSelect) Aggregate

func (ms *ModelSelect) Aggregate(fns ...AggregateFunc) *ModelSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ModelSelect) Bool

func (s *ModelSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ModelSelect) BoolX

func (s *ModelSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ModelSelect) Bools

func (s *ModelSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ModelSelect) BoolsX

func (s *ModelSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ModelSelect) Float64

func (s *ModelSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ModelSelect) Float64X

func (s *ModelSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ModelSelect) Float64s

func (s *ModelSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ModelSelect) Float64sX

func (s *ModelSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ModelSelect) Int

func (s *ModelSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ModelSelect) IntX

func (s *ModelSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ModelSelect) Ints

func (s *ModelSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ModelSelect) IntsX

func (s *ModelSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ModelSelect) Modify

func (ms *ModelSelect) Modify(modifiers ...func(s *sql.Selector)) *ModelSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ModelSelect) Scan

func (ms *ModelSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ModelSelect) ScanX

func (s *ModelSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ModelSelect) String

func (s *ModelSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ModelSelect) StringX

func (s *ModelSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ModelSelect) Strings

func (s *ModelSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ModelSelect) StringsX

func (s *ModelSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ModelUpdate

type ModelUpdate struct {
	// contains filtered or unexported fields
}

ModelUpdate is the builder for updating Model entities.

func (*ModelUpdate) AddAgentIDs

func (mu *ModelUpdate) AddAgentIDs(ids ...uuid.UUID) *ModelUpdate

AddAgentIDs adds the "agents" edge to the Agent entity by IDs.

func (*ModelUpdate) AddAgents

func (mu *ModelUpdate) AddAgents(a ...*Agent) *ModelUpdate

AddAgents adds the "agents" edges to the Agent entity.

func (*ModelUpdate) AddCacheReadCost

func (mu *ModelUpdate) AddCacheReadCost(f float64) *ModelUpdate

AddCacheReadCost adds f to the "cache_read_cost" field.

func (*ModelUpdate) AddCacheWriteCost

func (mu *ModelUpdate) AddCacheWriteCost(f float64) *ModelUpdate

AddCacheWriteCost adds f to the "cache_write_cost" field.

func (*ModelUpdate) AddContextWindow

func (mu *ModelUpdate) AddContextWindow(i int64) *ModelUpdate

AddContextWindow adds i to the "context_window" field.

func (*ModelUpdate) AddInputCost

func (mu *ModelUpdate) AddInputCost(f float64) *ModelUpdate

AddInputCost adds f to the "input_cost" field.

func (*ModelUpdate) AddMessageIDs

func (mu *ModelUpdate) AddMessageIDs(ids ...uuid.UUID) *ModelUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ModelUpdate) AddMessages

func (mu *ModelUpdate) AddMessages(m ...*Message) *ModelUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*ModelUpdate) AddOutputCost

func (mu *ModelUpdate) AddOutputCost(f float64) *ModelUpdate

AddOutputCost adds f to the "output_cost" field.

func (*ModelUpdate) AppendCapabilities

func (mu *ModelUpdate) AppendCapabilities(tc []types.ModelCapability) *ModelUpdate

AppendCapabilities appends tc to the "capabilities" field.

func (*ModelUpdate) ClearAgents

func (mu *ModelUpdate) ClearAgents() *ModelUpdate

ClearAgents clears all "agents" edges to the Agent entity.

func (*ModelUpdate) ClearAlias

func (mu *ModelUpdate) ClearAlias() *ModelUpdate

ClearAlias clears the value of the "alias" field.

func (*ModelUpdate) ClearCapabilities

func (mu *ModelUpdate) ClearCapabilities() *ModelUpdate

ClearCapabilities clears the value of the "capabilities" field.

func (*ModelUpdate) ClearMessages

func (mu *ModelUpdate) ClearMessages() *ModelUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*ModelUpdate) ClearModelProvider

func (mu *ModelUpdate) ClearModelProvider() *ModelUpdate

ClearModelProvider clears the "model_provider" edge to the ModelProvider entity.

func (*ModelUpdate) Exec

func (mu *ModelUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelUpdate) ExecX

func (mu *ModelUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelUpdate) Modify

func (mu *ModelUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ModelUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ModelUpdate) Mutation

func (mu *ModelUpdate) Mutation() *ModelMutation

Mutation returns the ModelMutation object of the builder.

func (*ModelUpdate) RemoveAgentIDs

func (mu *ModelUpdate) RemoveAgentIDs(ids ...uuid.UUID) *ModelUpdate

RemoveAgentIDs removes the "agents" edge to Agent entities by IDs.

func (*ModelUpdate) RemoveAgents

func (mu *ModelUpdate) RemoveAgents(a ...*Agent) *ModelUpdate

RemoveAgents removes "agents" edges to Agent entities.

func (*ModelUpdate) RemoveMessageIDs

func (mu *ModelUpdate) RemoveMessageIDs(ids ...uuid.UUID) *ModelUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ModelUpdate) RemoveMessages

func (mu *ModelUpdate) RemoveMessages(m ...*Message) *ModelUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*ModelUpdate) Save

func (mu *ModelUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ModelUpdate) SaveX

func (mu *ModelUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ModelUpdate) SetAlias

func (mu *ModelUpdate) SetAlias(s string) *ModelUpdate

SetAlias sets the "alias" field.

func (*ModelUpdate) SetCacheReadCost

func (mu *ModelUpdate) SetCacheReadCost(f float64) *ModelUpdate

SetCacheReadCost sets the "cache_read_cost" field.

func (*ModelUpdate) SetCacheWriteCost

func (mu *ModelUpdate) SetCacheWriteCost(f float64) *ModelUpdate

SetCacheWriteCost sets the "cache_write_cost" field.

func (*ModelUpdate) SetCapabilities

func (mu *ModelUpdate) SetCapabilities(tc []types.ModelCapability) *ModelUpdate

SetCapabilities sets the "capabilities" field.

func (*ModelUpdate) SetContextWindow

func (mu *ModelUpdate) SetContextWindow(i int64) *ModelUpdate

SetContextWindow sets the "context_window" field.

func (*ModelUpdate) SetEnabled

func (mu *ModelUpdate) SetEnabled(b bool) *ModelUpdate

SetEnabled sets the "enabled" field.

func (*ModelUpdate) SetInputCost

func (mu *ModelUpdate) SetInputCost(f float64) *ModelUpdate

SetInputCost sets the "input_cost" field.

func (*ModelUpdate) SetModelProvider

func (mu *ModelUpdate) SetModelProvider(m *ModelProvider) *ModelUpdate

SetModelProvider sets the "model_provider" edge to the ModelProvider entity.

func (*ModelUpdate) SetModelProviderID

func (mu *ModelUpdate) SetModelProviderID(u uuid.UUID) *ModelUpdate

SetModelProviderID sets the "model_provider_id" field.

func (*ModelUpdate) SetName

func (mu *ModelUpdate) SetName(s string) *ModelUpdate

SetName sets the "name" field.

func (*ModelUpdate) SetNillableAlias

func (mu *ModelUpdate) SetNillableAlias(s *string) *ModelUpdate

SetNillableAlias sets the "alias" field if the given value is not nil.

func (*ModelUpdate) SetNillableCacheReadCost

func (mu *ModelUpdate) SetNillableCacheReadCost(f *float64) *ModelUpdate

SetNillableCacheReadCost sets the "cache_read_cost" field if the given value is not nil.

func (*ModelUpdate) SetNillableCacheWriteCost

func (mu *ModelUpdate) SetNillableCacheWriteCost(f *float64) *ModelUpdate

SetNillableCacheWriteCost sets the "cache_write_cost" field if the given value is not nil.

func (*ModelUpdate) SetNillableContextWindow

func (mu *ModelUpdate) SetNillableContextWindow(i *int64) *ModelUpdate

SetNillableContextWindow sets the "context_window" field if the given value is not nil.

func (*ModelUpdate) SetNillableEnabled

func (mu *ModelUpdate) SetNillableEnabled(b *bool) *ModelUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ModelUpdate) SetNillableInputCost

func (mu *ModelUpdate) SetNillableInputCost(f *float64) *ModelUpdate

SetNillableInputCost sets the "input_cost" field if the given value is not nil.

func (*ModelUpdate) SetNillableModelProviderID

func (mu *ModelUpdate) SetNillableModelProviderID(u *uuid.UUID) *ModelUpdate

SetNillableModelProviderID sets the "model_provider_id" field if the given value is not nil.

func (*ModelUpdate) SetNillableName

func (mu *ModelUpdate) SetNillableName(s *string) *ModelUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ModelUpdate) SetNillableOutputCost

func (mu *ModelUpdate) SetNillableOutputCost(f *float64) *ModelUpdate

SetNillableOutputCost sets the "output_cost" field if the given value is not nil.

func (*ModelUpdate) SetOutputCost

func (mu *ModelUpdate) SetOutputCost(f float64) *ModelUpdate

SetOutputCost sets the "output_cost" field.

func (*ModelUpdate) SetUpdateTime

func (mu *ModelUpdate) SetUpdateTime(t time.Time) *ModelUpdate

SetUpdateTime sets the "update_time" field.

func (*ModelUpdate) Where

func (mu *ModelUpdate) Where(ps ...predicate.Model) *ModelUpdate

Where appends a list predicates to the ModelUpdate builder.

type ModelUpdateOne

type ModelUpdateOne struct {
	// contains filtered or unexported fields
}

ModelUpdateOne is the builder for updating a single Model entity.

func (*ModelUpdateOne) AddAgentIDs

func (muo *ModelUpdateOne) AddAgentIDs(ids ...uuid.UUID) *ModelUpdateOne

AddAgentIDs adds the "agents" edge to the Agent entity by IDs.

func (*ModelUpdateOne) AddAgents

func (muo *ModelUpdateOne) AddAgents(a ...*Agent) *ModelUpdateOne

AddAgents adds the "agents" edges to the Agent entity.

func (*ModelUpdateOne) AddCacheReadCost

func (muo *ModelUpdateOne) AddCacheReadCost(f float64) *ModelUpdateOne

AddCacheReadCost adds f to the "cache_read_cost" field.

func (*ModelUpdateOne) AddCacheWriteCost

func (muo *ModelUpdateOne) AddCacheWriteCost(f float64) *ModelUpdateOne

AddCacheWriteCost adds f to the "cache_write_cost" field.

func (*ModelUpdateOne) AddContextWindow

func (muo *ModelUpdateOne) AddContextWindow(i int64) *ModelUpdateOne

AddContextWindow adds i to the "context_window" field.

func (*ModelUpdateOne) AddInputCost

func (muo *ModelUpdateOne) AddInputCost(f float64) *ModelUpdateOne

AddInputCost adds f to the "input_cost" field.

func (*ModelUpdateOne) AddMessageIDs

func (muo *ModelUpdateOne) AddMessageIDs(ids ...uuid.UUID) *ModelUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ModelUpdateOne) AddMessages

func (muo *ModelUpdateOne) AddMessages(m ...*Message) *ModelUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*ModelUpdateOne) AddOutputCost

func (muo *ModelUpdateOne) AddOutputCost(f float64) *ModelUpdateOne

AddOutputCost adds f to the "output_cost" field.

func (*ModelUpdateOne) AppendCapabilities

func (muo *ModelUpdateOne) AppendCapabilities(tc []types.ModelCapability) *ModelUpdateOne

AppendCapabilities appends tc to the "capabilities" field.

func (*ModelUpdateOne) ClearAgents

func (muo *ModelUpdateOne) ClearAgents() *ModelUpdateOne

ClearAgents clears all "agents" edges to the Agent entity.

func (*ModelUpdateOne) ClearAlias

func (muo *ModelUpdateOne) ClearAlias() *ModelUpdateOne

ClearAlias clears the value of the "alias" field.

func (*ModelUpdateOne) ClearCapabilities

func (muo *ModelUpdateOne) ClearCapabilities() *ModelUpdateOne

ClearCapabilities clears the value of the "capabilities" field.

func (*ModelUpdateOne) ClearMessages

func (muo *ModelUpdateOne) ClearMessages() *ModelUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*ModelUpdateOne) ClearModelProvider

func (muo *ModelUpdateOne) ClearModelProvider() *ModelUpdateOne

ClearModelProvider clears the "model_provider" edge to the ModelProvider entity.

func (*ModelUpdateOne) Exec

func (muo *ModelUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ModelUpdateOne) ExecX

func (muo *ModelUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ModelUpdateOne) Modify

func (muo *ModelUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ModelUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ModelUpdateOne) Mutation

func (muo *ModelUpdateOne) Mutation() *ModelMutation

Mutation returns the ModelMutation object of the builder.

func (*ModelUpdateOne) RemoveAgentIDs

func (muo *ModelUpdateOne) RemoveAgentIDs(ids ...uuid.UUID) *ModelUpdateOne

RemoveAgentIDs removes the "agents" edge to Agent entities by IDs.

func (*ModelUpdateOne) RemoveAgents

func (muo *ModelUpdateOne) RemoveAgents(a ...*Agent) *ModelUpdateOne

RemoveAgents removes "agents" edges to Agent entities.

func (*ModelUpdateOne) RemoveMessageIDs

func (muo *ModelUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *ModelUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ModelUpdateOne) RemoveMessages

func (muo *ModelUpdateOne) RemoveMessages(m ...*Message) *ModelUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*ModelUpdateOne) Save

func (muo *ModelUpdateOne) Save(ctx context.Context) (*Model, error)

Save executes the query and returns the updated Model entity.

func (*ModelUpdateOne) SaveX

func (muo *ModelUpdateOne) SaveX(ctx context.Context) *Model

SaveX is like Save, but panics if an error occurs.

func (*ModelUpdateOne) Select

func (muo *ModelUpdateOne) Select(field string, fields ...string) *ModelUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ModelUpdateOne) SetAlias

func (muo *ModelUpdateOne) SetAlias(s string) *ModelUpdateOne

SetAlias sets the "alias" field.

func (*ModelUpdateOne) SetCacheReadCost

func (muo *ModelUpdateOne) SetCacheReadCost(f float64) *ModelUpdateOne

SetCacheReadCost sets the "cache_read_cost" field.

func (*ModelUpdateOne) SetCacheWriteCost

func (muo *ModelUpdateOne) SetCacheWriteCost(f float64) *ModelUpdateOne

SetCacheWriteCost sets the "cache_write_cost" field.

func (*ModelUpdateOne) SetCapabilities

func (muo *ModelUpdateOne) SetCapabilities(tc []types.ModelCapability) *ModelUpdateOne

SetCapabilities sets the "capabilities" field.

func (*ModelUpdateOne) SetContextWindow

func (muo *ModelUpdateOne) SetContextWindow(i int64) *ModelUpdateOne

SetContextWindow sets the "context_window" field.

func (*ModelUpdateOne) SetEnabled

func (muo *ModelUpdateOne) SetEnabled(b bool) *ModelUpdateOne

SetEnabled sets the "enabled" field.

func (*ModelUpdateOne) SetInputCost

func (muo *ModelUpdateOne) SetInputCost(f float64) *ModelUpdateOne

SetInputCost sets the "input_cost" field.

func (*ModelUpdateOne) SetModelProvider

func (muo *ModelUpdateOne) SetModelProvider(m *ModelProvider) *ModelUpdateOne

SetModelProvider sets the "model_provider" edge to the ModelProvider entity.

func (*ModelUpdateOne) SetModelProviderID

func (muo *ModelUpdateOne) SetModelProviderID(u uuid.UUID) *ModelUpdateOne

SetModelProviderID sets the "model_provider_id" field.

func (*ModelUpdateOne) SetName

func (muo *ModelUpdateOne) SetName(s string) *ModelUpdateOne

SetName sets the "name" field.

func (*ModelUpdateOne) SetNillableAlias

func (muo *ModelUpdateOne) SetNillableAlias(s *string) *ModelUpdateOne

SetNillableAlias sets the "alias" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableCacheReadCost

func (muo *ModelUpdateOne) SetNillableCacheReadCost(f *float64) *ModelUpdateOne

SetNillableCacheReadCost sets the "cache_read_cost" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableCacheWriteCost

func (muo *ModelUpdateOne) SetNillableCacheWriteCost(f *float64) *ModelUpdateOne

SetNillableCacheWriteCost sets the "cache_write_cost" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableContextWindow

func (muo *ModelUpdateOne) SetNillableContextWindow(i *int64) *ModelUpdateOne

SetNillableContextWindow sets the "context_window" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableEnabled

func (muo *ModelUpdateOne) SetNillableEnabled(b *bool) *ModelUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableInputCost

func (muo *ModelUpdateOne) SetNillableInputCost(f *float64) *ModelUpdateOne

SetNillableInputCost sets the "input_cost" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableModelProviderID

func (muo *ModelUpdateOne) SetNillableModelProviderID(u *uuid.UUID) *ModelUpdateOne

SetNillableModelProviderID sets the "model_provider_id" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableName

func (muo *ModelUpdateOne) SetNillableName(s *string) *ModelUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ModelUpdateOne) SetNillableOutputCost

func (muo *ModelUpdateOne) SetNillableOutputCost(f *float64) *ModelUpdateOne

SetNillableOutputCost sets the "output_cost" field if the given value is not nil.

func (*ModelUpdateOne) SetOutputCost

func (muo *ModelUpdateOne) SetOutputCost(f float64) *ModelUpdateOne

SetOutputCost sets the "output_cost" field.

func (*ModelUpdateOne) SetUpdateTime

func (muo *ModelUpdateOne) SetUpdateTime(t time.Time) *ModelUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ModelUpdateOne) Where

func (muo *ModelUpdateOne) Where(ps ...predicate.Model) *ModelUpdateOne

Where appends a list predicates to the ModelUpdate builder.

type Models

type Models []*Model

Models is a parsable slice of Model.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Task

type Task struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// ProjectDirectory holds the value of the "project_directory" field.
	ProjectDirectory string `json:"project_directory,omitempty"`
	// InputTokens holds the value of the "input_tokens" field.
	InputTokens int64 `json:"input_tokens,omitempty"`
	// OutputTokens holds the value of the "output_tokens" field.
	OutputTokens int64 `json:"output_tokens,omitempty"`
	// CacheWriteTokens holds the value of the "cache_write_tokens" field.
	CacheWriteTokens int64 `json:"cache_write_tokens,omitempty"`
	// CacheReadTokens holds the value of the "cache_read_tokens" field.
	CacheReadTokens int64 `json:"cache_read_tokens,omitempty"`
	// Cost holds the value of the "cost" field.
	Cost float64 `json:"cost,omitempty"`
	// Turns holds the value of the "turns" field.
	Turns int64 `json:"turns,omitempty"`
	// ToolUses holds the value of the "tool_uses" field.
	ToolUses map[string]int64 `json:"tool_uses,omitempty"`
	// DesiredPhase holds the value of the "desired_phase" field.
	DesiredPhase types.TaskPhase `json:"desired_phase,omitempty"`
	// Phase holds the value of the "phase" field.
	Phase types.TaskPhase `json:"phase,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID uuid.UUID `json:"agent_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskQuery when eager-loading is set.
	Edges TaskEdges `json:"edges"`
	// contains filtered or unexported fields
}

Task is the model entity for the Task schema.

func (*Task) QueryAgent

func (t *Task) QueryAgent() *AgentQuery

QueryAgent queries the "agent" edge of the Task entity.

func (*Task) QueryMessages

func (t *Task) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Task entity.

func (*Task) String

func (t *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (t *Task) Unwrap() *Task

Unwrap unwraps the Task entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Task) Update

func (t *Task) Update() *TaskUpdateOne

Update returns a builder for updating this Task. Note that you need to call Task.Unwrap() before calling this method if this Task was returned from a transaction, and the transaction was committed or rolled back.

func (*Task) Value

func (t *Task) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Task. This includes values selected through modifiers, order, etc.

type TaskClient

type TaskClient struct {
	// contains filtered or unexported fields
}

TaskClient is a client for the Task schema.

func NewTaskClient

func NewTaskClient(c config) *TaskClient

NewTaskClient returns a client for the Task from the given config.

func (*TaskClient) Create

func (c *TaskClient) Create() *TaskCreate

Create returns a builder for creating a Task entity.

func (*TaskClient) CreateBulk

func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk

CreateBulk returns a builder for creating a bulk of Task entities.

func (*TaskClient) Delete

func (c *TaskClient) Delete() *TaskDelete

Delete returns a delete builder for Task.

func (*TaskClient) DeleteOne

func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TaskClient) DeleteOneID

func (c *TaskClient) DeleteOneID(id uuid.UUID) *TaskDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, id uuid.UUID) (*Task, error)

Get returns a Task entity by its id.

func (*TaskClient) GetX

func (c *TaskClient) GetX(ctx context.Context, id uuid.UUID) *Task

GetX is like Get, but panics if an error occurs.

func (*TaskClient) Hooks

func (c *TaskClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TaskClient) Intercept

func (c *TaskClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `task.Intercept(f(g(h())))`.

func (*TaskClient) Interceptors

func (c *TaskClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TaskClient) MapCreateBulk

func (c *TaskClient) MapCreateBulk(slice any, setFunc func(*TaskCreate, int)) *TaskCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TaskClient) Query

func (c *TaskClient) Query() *TaskQuery

Query returns a query builder for Task.

func (*TaskClient) QueryAgent

func (c *TaskClient) QueryAgent(t *Task) *AgentQuery

QueryAgent queries the agent edge of a Task.

func (*TaskClient) QueryMessages

func (c *TaskClient) QueryMessages(t *Task) *MessageQuery

QueryMessages queries the messages edge of a Task.

func (*TaskClient) Update

func (c *TaskClient) Update() *TaskUpdate

Update returns an update builder for Task.

func (*TaskClient) UpdateOne

func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskClient) UpdateOneID

func (c *TaskClient) UpdateOneID(id uuid.UUID) *TaskUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskClient) Use

func (c *TaskClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `task.Hooks(f(g(h())))`.

type TaskCreate

type TaskCreate struct {
	// contains filtered or unexported fields
}

TaskCreate is the builder for creating a Task entity.

func (*TaskCreate) AddMessageIDs

func (tc *TaskCreate) AddMessageIDs(ids ...uuid.UUID) *TaskCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*TaskCreate) AddMessages

func (tc *TaskCreate) AddMessages(m ...*Message) *TaskCreate

AddMessages adds the "messages" edges to the Message entity.

func (*TaskCreate) Exec

func (tc *TaskCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreate) ExecX

func (tc *TaskCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskCreate) Mutation

func (tc *TaskCreate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskCreate) Save

func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)

Save creates the Task in the database.

func (*TaskCreate) SaveX

func (tc *TaskCreate) SaveX(ctx context.Context) *Task

SaveX calls Save and panics if Save returns an error.

func (*TaskCreate) SetAgent

func (tc *TaskCreate) SetAgent(a *Agent) *TaskCreate

SetAgent sets the "agent" edge to the Agent entity.

func (*TaskCreate) SetAgentID

func (tc *TaskCreate) SetAgentID(u uuid.UUID) *TaskCreate

SetAgentID sets the "agent_id" field.

func (*TaskCreate) SetCacheReadTokens

func (tc *TaskCreate) SetCacheReadTokens(i int64) *TaskCreate

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*TaskCreate) SetCacheWriteTokens

func (tc *TaskCreate) SetCacheWriteTokens(i int64) *TaskCreate

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*TaskCreate) SetCost

func (tc *TaskCreate) SetCost(f float64) *TaskCreate

SetCost sets the "cost" field.

func (*TaskCreate) SetCreateTime

func (tc *TaskCreate) SetCreateTime(t time.Time) *TaskCreate

SetCreateTime sets the "create_time" field.

func (*TaskCreate) SetDescription

func (tc *TaskCreate) SetDescription(s string) *TaskCreate

SetDescription sets the "description" field.

func (*TaskCreate) SetDesiredPhase

func (tc *TaskCreate) SetDesiredPhase(tp types.TaskPhase) *TaskCreate

SetDesiredPhase sets the "desired_phase" field.

func (*TaskCreate) SetID

func (tc *TaskCreate) SetID(u uuid.UUID) *TaskCreate

SetID sets the "id" field.

func (*TaskCreate) SetInputTokens

func (tc *TaskCreate) SetInputTokens(i int64) *TaskCreate

SetInputTokens sets the "input_tokens" field.

func (*TaskCreate) SetNillableAgentID

func (tc *TaskCreate) SetNillableAgentID(u *uuid.UUID) *TaskCreate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskCreate) SetNillableCacheReadTokens

func (tc *TaskCreate) SetNillableCacheReadTokens(i *int64) *TaskCreate

SetNillableCacheReadTokens sets the "cache_read_tokens" field if the given value is not nil.

func (*TaskCreate) SetNillableCacheWriteTokens

func (tc *TaskCreate) SetNillableCacheWriteTokens(i *int64) *TaskCreate

SetNillableCacheWriteTokens sets the "cache_write_tokens" field if the given value is not nil.

func (*TaskCreate) SetNillableCost

func (tc *TaskCreate) SetNillableCost(f *float64) *TaskCreate

SetNillableCost sets the "cost" field if the given value is not nil.

func (*TaskCreate) SetNillableCreateTime

func (tc *TaskCreate) SetNillableCreateTime(t *time.Time) *TaskCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*TaskCreate) SetNillableDescription

func (tc *TaskCreate) SetNillableDescription(s *string) *TaskCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskCreate) SetNillableDesiredPhase

func (tc *TaskCreate) SetNillableDesiredPhase(tp *types.TaskPhase) *TaskCreate

SetNillableDesiredPhase sets the "desired_phase" field if the given value is not nil.

func (*TaskCreate) SetNillableID

func (tc *TaskCreate) SetNillableID(u *uuid.UUID) *TaskCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TaskCreate) SetNillableInputTokens

func (tc *TaskCreate) SetNillableInputTokens(i *int64) *TaskCreate

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*TaskCreate) SetNillableOutputTokens

func (tc *TaskCreate) SetNillableOutputTokens(i *int64) *TaskCreate

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*TaskCreate) SetNillablePhase

func (tc *TaskCreate) SetNillablePhase(tp *types.TaskPhase) *TaskCreate

SetNillablePhase sets the "phase" field if the given value is not nil.

func (*TaskCreate) SetNillableProjectDirectory

func (tc *TaskCreate) SetNillableProjectDirectory(s *string) *TaskCreate

SetNillableProjectDirectory sets the "project_directory" field if the given value is not nil.

func (*TaskCreate) SetNillableTurns

func (tc *TaskCreate) SetNillableTurns(i *int64) *TaskCreate

SetNillableTurns sets the "turns" field if the given value is not nil.

func (*TaskCreate) SetNillableUpdateTime

func (tc *TaskCreate) SetNillableUpdateTime(t *time.Time) *TaskCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*TaskCreate) SetOutputTokens

func (tc *TaskCreate) SetOutputTokens(i int64) *TaskCreate

SetOutputTokens sets the "output_tokens" field.

func (*TaskCreate) SetPhase

func (tc *TaskCreate) SetPhase(tp types.TaskPhase) *TaskCreate

SetPhase sets the "phase" field.

func (*TaskCreate) SetProjectDirectory

func (tc *TaskCreate) SetProjectDirectory(s string) *TaskCreate

SetProjectDirectory sets the "project_directory" field.

func (*TaskCreate) SetToolUses

func (tc *TaskCreate) SetToolUses(m map[string]int64) *TaskCreate

SetToolUses sets the "tool_uses" field.

func (*TaskCreate) SetTurns

func (tc *TaskCreate) SetTurns(i int64) *TaskCreate

SetTurns sets the "turns" field.

func (*TaskCreate) SetUpdateTime

func (tc *TaskCreate) SetUpdateTime(t time.Time) *TaskCreate

SetUpdateTime sets the "update_time" field.

type TaskCreateBulk

type TaskCreateBulk struct {
	// contains filtered or unexported fields
}

TaskCreateBulk is the builder for creating many Task entities in bulk.

func (*TaskCreateBulk) Exec

func (tcb *TaskCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreateBulk) ExecX

func (tcb *TaskCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskCreateBulk) Save

func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error)

Save creates the Task entities in the database.

func (*TaskCreateBulk) SaveX

func (tcb *TaskCreateBulk) SaveX(ctx context.Context) []*Task

SaveX is like Save, but panics if an error occurs.

type TaskDelete

type TaskDelete struct {
	// contains filtered or unexported fields
}

TaskDelete is the builder for deleting a Task entity.

func (*TaskDelete) Exec

func (td *TaskDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TaskDelete) ExecX

func (td *TaskDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TaskDelete) Where

func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete

Where appends a list predicates to the TaskDelete builder.

type TaskDeleteOne

type TaskDeleteOne struct {
	// contains filtered or unexported fields
}

TaskDeleteOne is the builder for deleting a single Task entity.

func (*TaskDeleteOne) Exec

func (tdo *TaskDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskDeleteOne) ExecX

func (tdo *TaskDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskDeleteOne) Where

func (tdo *TaskDeleteOne) Where(ps ...predicate.Task) *TaskDeleteOne

Where appends a list predicates to the TaskDelete builder.

type TaskEdges

type TaskEdges struct {
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// Agent holds the value of the agent edge.
	Agent *Agent `json:"agent,omitempty"`
	// contains filtered or unexported fields
}

TaskEdges holds the relations/edges for other nodes in the graph.

func (TaskEdges) AgentOrErr

func (e TaskEdges) AgentOrErr() (*Agent, error)

AgentOrErr returns the Agent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TaskEdges) MessagesOrErr

func (e TaskEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

type TaskGroupBy

type TaskGroupBy struct {
	// contains filtered or unexported fields
}

TaskGroupBy is the group-by builder for Task entities.

func (*TaskGroupBy) Aggregate

func (tgb *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TaskGroupBy) Bool

func (s *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) BoolX

func (s *TaskGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskGroupBy) Bools

func (s *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) BoolsX

func (s *TaskGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskGroupBy) Float64

func (s *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) Float64X

func (s *TaskGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskGroupBy) Float64s

func (s *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) Float64sX

func (s *TaskGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskGroupBy) Int

func (s *TaskGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) IntX

func (s *TaskGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskGroupBy) Ints

func (s *TaskGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) IntsX

func (s *TaskGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskGroupBy) Scan

func (tgb *TaskGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TaskGroupBy) ScanX

func (s *TaskGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TaskGroupBy) String

func (s *TaskGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) StringX

func (s *TaskGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskGroupBy) Strings

func (s *TaskGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskGroupBy) StringsX

func (s *TaskGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskMutation

type TaskMutation struct {
	// contains filtered or unexported fields
}

TaskMutation represents an operation that mutates the Task nodes in the graph.

func (*TaskMutation) AddCacheReadTokens

func (m *TaskMutation) AddCacheReadTokens(i int64)

AddCacheReadTokens adds i to the "cache_read_tokens" field.

func (*TaskMutation) AddCacheWriteTokens

func (m *TaskMutation) AddCacheWriteTokens(i int64)

AddCacheWriteTokens adds i to the "cache_write_tokens" field.

func (*TaskMutation) AddCost

func (m *TaskMutation) AddCost(f float64)

AddCost adds f to the "cost" field.

func (*TaskMutation) AddField

func (m *TaskMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TaskMutation) AddInputTokens

func (m *TaskMutation) AddInputTokens(i int64)

AddInputTokens adds i to the "input_tokens" field.

func (*TaskMutation) AddMessageIDs

func (m *TaskMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*TaskMutation) AddOutputTokens

func (m *TaskMutation) AddOutputTokens(i int64)

AddOutputTokens adds i to the "output_tokens" field.

func (*TaskMutation) AddTurns

func (m *TaskMutation) AddTurns(i int64)

AddTurns adds i to the "turns" field.

func (*TaskMutation) AddedCacheReadTokens

func (m *TaskMutation) AddedCacheReadTokens() (r int64, exists bool)

AddedCacheReadTokens returns the value that was added to the "cache_read_tokens" field in this mutation.

func (*TaskMutation) AddedCacheWriteTokens

func (m *TaskMutation) AddedCacheWriteTokens() (r int64, exists bool)

AddedCacheWriteTokens returns the value that was added to the "cache_write_tokens" field in this mutation.

func (*TaskMutation) AddedCost

func (m *TaskMutation) AddedCost() (r float64, exists bool)

AddedCost returns the value that was added to the "cost" field in this mutation.

func (*TaskMutation) AddedEdges

func (m *TaskMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TaskMutation) AddedField

func (m *TaskMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TaskMutation) AddedFields

func (m *TaskMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TaskMutation) AddedIDs

func (m *TaskMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TaskMutation) AddedInputTokens

func (m *TaskMutation) AddedInputTokens() (r int64, exists bool)

AddedInputTokens returns the value that was added to the "input_tokens" field in this mutation.

func (*TaskMutation) AddedOutputTokens

func (m *TaskMutation) AddedOutputTokens() (r int64, exists bool)

AddedOutputTokens returns the value that was added to the "output_tokens" field in this mutation.

func (*TaskMutation) AddedTurns

func (m *TaskMutation) AddedTurns() (r int64, exists bool)

AddedTurns returns the value that was added to the "turns" field in this mutation.

func (*TaskMutation) AgentCleared

func (m *TaskMutation) AgentCleared() bool

AgentCleared reports if the "agent" edge to the Agent entity was cleared.

func (*TaskMutation) AgentID

func (m *TaskMutation) AgentID() (r uuid.UUID, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*TaskMutation) AgentIDCleared

func (m *TaskMutation) AgentIDCleared() bool

AgentIDCleared returns if the "agent_id" field was cleared in this mutation.

func (*TaskMutation) AgentIDs

func (m *TaskMutation) AgentIDs() (ids []uuid.UUID)

AgentIDs returns the "agent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AgentID instead. It exists only for internal usage by the builders.

func (*TaskMutation) CacheReadTokens

func (m *TaskMutation) CacheReadTokens() (r int64, exists bool)

CacheReadTokens returns the value of the "cache_read_tokens" field in the mutation.

func (*TaskMutation) CacheReadTokensCleared

func (m *TaskMutation) CacheReadTokensCleared() bool

CacheReadTokensCleared returns if the "cache_read_tokens" field was cleared in this mutation.

func (*TaskMutation) CacheWriteTokens

func (m *TaskMutation) CacheWriteTokens() (r int64, exists bool)

CacheWriteTokens returns the value of the "cache_write_tokens" field in the mutation.

func (*TaskMutation) CacheWriteTokensCleared

func (m *TaskMutation) CacheWriteTokensCleared() bool

CacheWriteTokensCleared returns if the "cache_write_tokens" field was cleared in this mutation.

func (*TaskMutation) ClearAgent

func (m *TaskMutation) ClearAgent()

ClearAgent clears the "agent" edge to the Agent entity.

func (*TaskMutation) ClearAgentID

func (m *TaskMutation) ClearAgentID()

ClearAgentID clears the value of the "agent_id" field.

func (*TaskMutation) ClearCacheReadTokens

func (m *TaskMutation) ClearCacheReadTokens()

ClearCacheReadTokens clears the value of the "cache_read_tokens" field.

func (*TaskMutation) ClearCacheWriteTokens

func (m *TaskMutation) ClearCacheWriteTokens()

ClearCacheWriteTokens clears the value of the "cache_write_tokens" field.

func (*TaskMutation) ClearCost

func (m *TaskMutation) ClearCost()

ClearCost clears the value of the "cost" field.

func (*TaskMutation) ClearDescription

func (m *TaskMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*TaskMutation) ClearEdge

func (m *TaskMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TaskMutation) ClearField

func (m *TaskMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TaskMutation) ClearInputTokens

func (m *TaskMutation) ClearInputTokens()

ClearInputTokens clears the value of the "input_tokens" field.

func (*TaskMutation) ClearMessages

func (m *TaskMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*TaskMutation) ClearOutputTokens

func (m *TaskMutation) ClearOutputTokens()

ClearOutputTokens clears the value of the "output_tokens" field.

func (*TaskMutation) ClearProjectDirectory

func (m *TaskMutation) ClearProjectDirectory()

ClearProjectDirectory clears the value of the "project_directory" field.

func (*TaskMutation) ClearedEdges

func (m *TaskMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TaskMutation) ClearedFields

func (m *TaskMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TaskMutation) Client

func (m TaskMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TaskMutation) Cost

func (m *TaskMutation) Cost() (r float64, exists bool)

Cost returns the value of the "cost" field in the mutation.

func (*TaskMutation) CostCleared

func (m *TaskMutation) CostCleared() bool

CostCleared returns if the "cost" field was cleared in this mutation.

func (*TaskMutation) CreateTime

func (m *TaskMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*TaskMutation) Description

func (m *TaskMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*TaskMutation) DescriptionCleared

func (m *TaskMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*TaskMutation) DesiredPhase

func (m *TaskMutation) DesiredPhase() (r types.TaskPhase, exists bool)

DesiredPhase returns the value of the "desired_phase" field in the mutation.

func (*TaskMutation) EdgeCleared

func (m *TaskMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TaskMutation) Field

func (m *TaskMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TaskMutation) FieldCleared

func (m *TaskMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TaskMutation) Fields

func (m *TaskMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TaskMutation) ID

func (m *TaskMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TaskMutation) IDs

func (m *TaskMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TaskMutation) InputTokens

func (m *TaskMutation) InputTokens() (r int64, exists bool)

InputTokens returns the value of the "input_tokens" field in the mutation.

func (*TaskMutation) InputTokensCleared

func (m *TaskMutation) InputTokensCleared() bool

InputTokensCleared returns if the "input_tokens" field was cleared in this mutation.

func (*TaskMutation) MessagesCleared

func (m *TaskMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*TaskMutation) MessagesIDs

func (m *TaskMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*TaskMutation) OldAgentID

func (m *TaskMutation) OldAgentID(ctx context.Context) (v uuid.UUID, err error)

OldAgentID returns the old "agent_id" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldCacheReadTokens

func (m *TaskMutation) OldCacheReadTokens(ctx context.Context) (v int64, err error)

OldCacheReadTokens returns the old "cache_read_tokens" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldCacheWriteTokens

func (m *TaskMutation) OldCacheWriteTokens(ctx context.Context) (v int64, err error)

OldCacheWriteTokens returns the old "cache_write_tokens" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldCost

func (m *TaskMutation) OldCost(ctx context.Context) (v float64, err error)

OldCost returns the old "cost" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldCreateTime

func (m *TaskMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldDescription

func (m *TaskMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldDesiredPhase

func (m *TaskMutation) OldDesiredPhase(ctx context.Context) (v types.TaskPhase, err error)

OldDesiredPhase returns the old "desired_phase" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldField

func (m *TaskMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TaskMutation) OldInputTokens

func (m *TaskMutation) OldInputTokens(ctx context.Context) (v int64, err error)

OldInputTokens returns the old "input_tokens" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldOutputTokens

func (m *TaskMutation) OldOutputTokens(ctx context.Context) (v int64, err error)

OldOutputTokens returns the old "output_tokens" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldPhase

func (m *TaskMutation) OldPhase(ctx context.Context) (v types.TaskPhase, err error)

OldPhase returns the old "phase" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldProjectDirectory

func (m *TaskMutation) OldProjectDirectory(ctx context.Context) (v string, err error)

OldProjectDirectory returns the old "project_directory" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldToolUses

func (m *TaskMutation) OldToolUses(ctx context.Context) (v map[string]int64, err error)

OldToolUses returns the old "tool_uses" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldTurns

func (m *TaskMutation) OldTurns(ctx context.Context) (v int64, err error)

OldTurns returns the old "turns" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) OldUpdateTime

func (m *TaskMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Task entity. If the Task object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) OutputTokens

func (m *TaskMutation) OutputTokens() (r int64, exists bool)

OutputTokens returns the value of the "output_tokens" field in the mutation.

func (*TaskMutation) OutputTokensCleared

func (m *TaskMutation) OutputTokensCleared() bool

OutputTokensCleared returns if the "output_tokens" field was cleared in this mutation.

func (*TaskMutation) Phase

func (m *TaskMutation) Phase() (r types.TaskPhase, exists bool)

Phase returns the value of the "phase" field in the mutation.

func (*TaskMutation) ProjectDirectory

func (m *TaskMutation) ProjectDirectory() (r string, exists bool)

ProjectDirectory returns the value of the "project_directory" field in the mutation.

func (*TaskMutation) ProjectDirectoryCleared

func (m *TaskMutation) ProjectDirectoryCleared() bool

ProjectDirectoryCleared returns if the "project_directory" field was cleared in this mutation.

func (*TaskMutation) RemoveMessageIDs

func (m *TaskMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*TaskMutation) RemovedEdges

func (m *TaskMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TaskMutation) RemovedIDs

func (m *TaskMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TaskMutation) RemovedMessagesIDs

func (m *TaskMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*TaskMutation) ResetAgent

func (m *TaskMutation) ResetAgent()

ResetAgent resets all changes to the "agent" edge.

func (*TaskMutation) ResetAgentID

func (m *TaskMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*TaskMutation) ResetCacheReadTokens

func (m *TaskMutation) ResetCacheReadTokens()

ResetCacheReadTokens resets all changes to the "cache_read_tokens" field.

func (*TaskMutation) ResetCacheWriteTokens

func (m *TaskMutation) ResetCacheWriteTokens()

ResetCacheWriteTokens resets all changes to the "cache_write_tokens" field.

func (*TaskMutation) ResetCost

func (m *TaskMutation) ResetCost()

ResetCost resets all changes to the "cost" field.

func (*TaskMutation) ResetCreateTime

func (m *TaskMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*TaskMutation) ResetDescription

func (m *TaskMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TaskMutation) ResetDesiredPhase

func (m *TaskMutation) ResetDesiredPhase()

ResetDesiredPhase resets all changes to the "desired_phase" field.

func (*TaskMutation) ResetEdge

func (m *TaskMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TaskMutation) ResetField

func (m *TaskMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TaskMutation) ResetInputTokens

func (m *TaskMutation) ResetInputTokens()

ResetInputTokens resets all changes to the "input_tokens" field.

func (*TaskMutation) ResetMessages

func (m *TaskMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*TaskMutation) ResetOutputTokens

func (m *TaskMutation) ResetOutputTokens()

ResetOutputTokens resets all changes to the "output_tokens" field.

func (*TaskMutation) ResetPhase

func (m *TaskMutation) ResetPhase()

ResetPhase resets all changes to the "phase" field.

func (*TaskMutation) ResetProjectDirectory

func (m *TaskMutation) ResetProjectDirectory()

ResetProjectDirectory resets all changes to the "project_directory" field.

func (*TaskMutation) ResetToolUses

func (m *TaskMutation) ResetToolUses()

ResetToolUses resets all changes to the "tool_uses" field.

func (*TaskMutation) ResetTurns

func (m *TaskMutation) ResetTurns()

ResetTurns resets all changes to the "turns" field.

func (*TaskMutation) ResetUpdateTime

func (m *TaskMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*TaskMutation) SetAgentID

func (m *TaskMutation) SetAgentID(u uuid.UUID)

SetAgentID sets the "agent_id" field.

func (*TaskMutation) SetCacheReadTokens

func (m *TaskMutation) SetCacheReadTokens(i int64)

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*TaskMutation) SetCacheWriteTokens

func (m *TaskMutation) SetCacheWriteTokens(i int64)

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*TaskMutation) SetCost

func (m *TaskMutation) SetCost(f float64)

SetCost sets the "cost" field.

func (*TaskMutation) SetCreateTime

func (m *TaskMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*TaskMutation) SetDescription

func (m *TaskMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TaskMutation) SetDesiredPhase

func (m *TaskMutation) SetDesiredPhase(tp types.TaskPhase)

SetDesiredPhase sets the "desired_phase" field.

func (*TaskMutation) SetField

func (m *TaskMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TaskMutation) SetID

func (m *TaskMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Task entities.

func (*TaskMutation) SetInputTokens

func (m *TaskMutation) SetInputTokens(i int64)

SetInputTokens sets the "input_tokens" field.

func (*TaskMutation) SetOp

func (m *TaskMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TaskMutation) SetOutputTokens

func (m *TaskMutation) SetOutputTokens(i int64)

SetOutputTokens sets the "output_tokens" field.

func (*TaskMutation) SetPhase

func (m *TaskMutation) SetPhase(tp types.TaskPhase)

SetPhase sets the "phase" field.

func (*TaskMutation) SetProjectDirectory

func (m *TaskMutation) SetProjectDirectory(s string)

SetProjectDirectory sets the "project_directory" field.

func (*TaskMutation) SetToolUses

func (m *TaskMutation) SetToolUses(value map[string]int64)

SetToolUses sets the "tool_uses" field.

func (*TaskMutation) SetTurns

func (m *TaskMutation) SetTurns(i int64)

SetTurns sets the "turns" field.

func (*TaskMutation) SetUpdateTime

func (m *TaskMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*TaskMutation) ToolUses

func (m *TaskMutation) ToolUses() (r map[string]int64, exists bool)

ToolUses returns the value of the "tool_uses" field in the mutation.

func (*TaskMutation) Turns

func (m *TaskMutation) Turns() (r int64, exists bool)

Turns returns the value of the "turns" field in the mutation.

func (TaskMutation) Tx

func (m TaskMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TaskMutation) Type

func (m *TaskMutation) Type() string

Type returns the node type of this mutation (Task).

func (*TaskMutation) UpdateTime

func (m *TaskMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*TaskMutation) Where

func (m *TaskMutation) Where(ps ...predicate.Task)

Where appends a list predicates to the TaskMutation builder.

func (*TaskMutation) WhereP

func (m *TaskMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TaskMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TaskQuery

type TaskQuery struct {
	// contains filtered or unexported fields
}

TaskQuery is the builder for querying Task entities.

func (*TaskQuery) Aggregate

func (tq *TaskQuery) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate returns a TaskSelect configured with the given aggregations.

func (*TaskQuery) All

func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)

All executes the query and returns a list of Tasks.

func (*TaskQuery) AllX

func (tq *TaskQuery) AllX(ctx context.Context) []*Task

AllX is like All, but panics if an error occurs.

func (*TaskQuery) Clone

func (tq *TaskQuery) Clone() *TaskQuery

Clone returns a duplicate of the TaskQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TaskQuery) Count

func (tq *TaskQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskQuery) CountX

func (tq *TaskQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TaskQuery) Exist

func (tq *TaskQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TaskQuery) ExistX

func (tq *TaskQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TaskQuery) First

func (tq *TaskQuery) First(ctx context.Context) (*Task, error)

First returns the first Task entity from the query. Returns a *NotFoundError when no Task was found.

func (*TaskQuery) FirstID

func (tq *TaskQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Task ID from the query. Returns a *NotFoundError when no Task ID was found.

func (*TaskQuery) FirstIDX

func (tq *TaskQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TaskQuery) FirstX

func (tq *TaskQuery) FirstX(ctx context.Context) *Task

FirstX is like First, but panics if an error occurs.

func (*TaskQuery) GroupBy

func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Task.Query().
	GroupBy(task.FieldCreateTime).
	Aggregate(memory.Count()).
	Scan(ctx, &v)

func (*TaskQuery) IDs

func (tq *TaskQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Task IDs.

func (*TaskQuery) IDsX

func (tq *TaskQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TaskQuery) Limit

func (tq *TaskQuery) Limit(limit int) *TaskQuery

Limit the number of records to be returned by this query.

func (*TaskQuery) Modify

func (tq *TaskQuery) Modify(modifiers ...func(s *sql.Selector)) *TaskSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TaskQuery) Offset

func (tq *TaskQuery) Offset(offset int) *TaskQuery

Offset to start from.

func (*TaskQuery) Only

func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)

Only returns a single Task entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Task entity is found. Returns a *NotFoundError when no Task entities are found.

func (*TaskQuery) OnlyID

func (tq *TaskQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Task ID in the query. Returns a *NotSingularError when more than one Task ID is found. Returns a *NotFoundError when no entities are found.

func (*TaskQuery) OnlyIDX

func (tq *TaskQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TaskQuery) OnlyX

func (tq *TaskQuery) OnlyX(ctx context.Context) *Task

OnlyX is like Only, but panics if an error occurs.

func (*TaskQuery) Order

func (tq *TaskQuery) Order(o ...task.OrderOption) *TaskQuery

Order specifies how the records should be ordered.

func (*TaskQuery) QueryAgent

func (tq *TaskQuery) QueryAgent() *AgentQuery

QueryAgent chains the current query on the "agent" edge.

func (*TaskQuery) QueryMessages

func (tq *TaskQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*TaskQuery) Select

func (tq *TaskQuery) Select(fields ...string) *TaskSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Task.Query().
	Select(task.FieldCreateTime).
	Scan(ctx, &v)

func (*TaskQuery) Unique

func (tq *TaskQuery) Unique(unique bool) *TaskQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TaskQuery) Where

func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the TaskQuery builder.

func (*TaskQuery) WithAgent

func (tq *TaskQuery) WithAgent(opts ...func(*AgentQuery)) *TaskQuery

WithAgent tells the query-builder to eager-load the nodes that are connected to the "agent" edge. The optional arguments are used to configure the query builder of the edge.

func (*TaskQuery) WithMessages

func (tq *TaskQuery) WithMessages(opts ...func(*MessageQuery)) *TaskQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

type TaskSelect

type TaskSelect struct {
	*TaskQuery
	// contains filtered or unexported fields
}

TaskSelect is the builder for selecting fields of Task entities.

func (*TaskSelect) Aggregate

func (ts *TaskSelect) Aggregate(fns ...AggregateFunc) *TaskSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TaskSelect) Bool

func (s *TaskSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolX

func (s *TaskSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TaskSelect) Bools

func (s *TaskSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TaskSelect) BoolsX

func (s *TaskSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TaskSelect) Float64

func (s *TaskSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64X

func (s *TaskSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TaskSelect) Float64s

func (s *TaskSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TaskSelect) Float64sX

func (s *TaskSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TaskSelect) Int

func (s *TaskSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntX

func (s *TaskSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TaskSelect) Ints

func (s *TaskSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TaskSelect) IntsX

func (s *TaskSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TaskSelect) Modify

func (ts *TaskSelect) Modify(modifiers ...func(s *sql.Selector)) *TaskSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TaskSelect) Scan

func (ts *TaskSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TaskSelect) ScanX

func (s *TaskSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TaskSelect) String

func (s *TaskSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringX

func (s *TaskSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TaskSelect) Strings

func (s *TaskSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TaskSelect) StringsX

func (s *TaskSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TaskUpdate

type TaskUpdate struct {
	// contains filtered or unexported fields
}

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) AddCacheReadTokens

func (tu *TaskUpdate) AddCacheReadTokens(i int64) *TaskUpdate

AddCacheReadTokens adds i to the "cache_read_tokens" field.

func (*TaskUpdate) AddCacheWriteTokens

func (tu *TaskUpdate) AddCacheWriteTokens(i int64) *TaskUpdate

AddCacheWriteTokens adds i to the "cache_write_tokens" field.

func (*TaskUpdate) AddCost

func (tu *TaskUpdate) AddCost(f float64) *TaskUpdate

AddCost adds f to the "cost" field.

func (*TaskUpdate) AddInputTokens

func (tu *TaskUpdate) AddInputTokens(i int64) *TaskUpdate

AddInputTokens adds i to the "input_tokens" field.

func (*TaskUpdate) AddMessageIDs

func (tu *TaskUpdate) AddMessageIDs(ids ...uuid.UUID) *TaskUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*TaskUpdate) AddMessages

func (tu *TaskUpdate) AddMessages(m ...*Message) *TaskUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*TaskUpdate) AddOutputTokens

func (tu *TaskUpdate) AddOutputTokens(i int64) *TaskUpdate

AddOutputTokens adds i to the "output_tokens" field.

func (*TaskUpdate) AddTurns

func (tu *TaskUpdate) AddTurns(i int64) *TaskUpdate

AddTurns adds i to the "turns" field.

func (*TaskUpdate) ClearAgent

func (tu *TaskUpdate) ClearAgent() *TaskUpdate

ClearAgent clears the "agent" edge to the Agent entity.

func (*TaskUpdate) ClearAgentID

func (tu *TaskUpdate) ClearAgentID() *TaskUpdate

ClearAgentID clears the value of the "agent_id" field.

func (*TaskUpdate) ClearCacheReadTokens

func (tu *TaskUpdate) ClearCacheReadTokens() *TaskUpdate

ClearCacheReadTokens clears the value of the "cache_read_tokens" field.

func (*TaskUpdate) ClearCacheWriteTokens

func (tu *TaskUpdate) ClearCacheWriteTokens() *TaskUpdate

ClearCacheWriteTokens clears the value of the "cache_write_tokens" field.

func (*TaskUpdate) ClearCost

func (tu *TaskUpdate) ClearCost() *TaskUpdate

ClearCost clears the value of the "cost" field.

func (*TaskUpdate) ClearDescription

func (tu *TaskUpdate) ClearDescription() *TaskUpdate

ClearDescription clears the value of the "description" field.

func (*TaskUpdate) ClearInputTokens

func (tu *TaskUpdate) ClearInputTokens() *TaskUpdate

ClearInputTokens clears the value of the "input_tokens" field.

func (*TaskUpdate) ClearMessages

func (tu *TaskUpdate) ClearMessages() *TaskUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*TaskUpdate) ClearOutputTokens

func (tu *TaskUpdate) ClearOutputTokens() *TaskUpdate

ClearOutputTokens clears the value of the "output_tokens" field.

func (*TaskUpdate) ClearProjectDirectory

func (tu *TaskUpdate) ClearProjectDirectory() *TaskUpdate

ClearProjectDirectory clears the value of the "project_directory" field.

func (*TaskUpdate) Exec

func (tu *TaskUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpdate) ExecX

func (tu *TaskUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdate) Modify

func (tu *TaskUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TaskUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TaskUpdate) Mutation

func (tu *TaskUpdate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdate) RemoveMessageIDs

func (tu *TaskUpdate) RemoveMessageIDs(ids ...uuid.UUID) *TaskUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*TaskUpdate) RemoveMessages

func (tu *TaskUpdate) RemoveMessages(m ...*Message) *TaskUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*TaskUpdate) Save

func (tu *TaskUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TaskUpdate) SaveX

func (tu *TaskUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdate) SetAgent

func (tu *TaskUpdate) SetAgent(a *Agent) *TaskUpdate

SetAgent sets the "agent" edge to the Agent entity.

func (*TaskUpdate) SetAgentID

func (tu *TaskUpdate) SetAgentID(u uuid.UUID) *TaskUpdate

SetAgentID sets the "agent_id" field.

func (*TaskUpdate) SetCacheReadTokens

func (tu *TaskUpdate) SetCacheReadTokens(i int64) *TaskUpdate

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*TaskUpdate) SetCacheWriteTokens

func (tu *TaskUpdate) SetCacheWriteTokens(i int64) *TaskUpdate

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*TaskUpdate) SetCost

func (tu *TaskUpdate) SetCost(f float64) *TaskUpdate

SetCost sets the "cost" field.

func (*TaskUpdate) SetDescription

func (tu *TaskUpdate) SetDescription(s string) *TaskUpdate

SetDescription sets the "description" field.

func (*TaskUpdate) SetDesiredPhase

func (tu *TaskUpdate) SetDesiredPhase(tp types.TaskPhase) *TaskUpdate

SetDesiredPhase sets the "desired_phase" field.

func (*TaskUpdate) SetInputTokens

func (tu *TaskUpdate) SetInputTokens(i int64) *TaskUpdate

SetInputTokens sets the "input_tokens" field.

func (*TaskUpdate) SetNillableAgentID

func (tu *TaskUpdate) SetNillableAgentID(u *uuid.UUID) *TaskUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskUpdate) SetNillableCacheReadTokens

func (tu *TaskUpdate) SetNillableCacheReadTokens(i *int64) *TaskUpdate

SetNillableCacheReadTokens sets the "cache_read_tokens" field if the given value is not nil.

func (*TaskUpdate) SetNillableCacheWriteTokens

func (tu *TaskUpdate) SetNillableCacheWriteTokens(i *int64) *TaskUpdate

SetNillableCacheWriteTokens sets the "cache_write_tokens" field if the given value is not nil.

func (*TaskUpdate) SetNillableCost

func (tu *TaskUpdate) SetNillableCost(f *float64) *TaskUpdate

SetNillableCost sets the "cost" field if the given value is not nil.

func (*TaskUpdate) SetNillableDescription

func (tu *TaskUpdate) SetNillableDescription(s *string) *TaskUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskUpdate) SetNillableDesiredPhase

func (tu *TaskUpdate) SetNillableDesiredPhase(tp *types.TaskPhase) *TaskUpdate

SetNillableDesiredPhase sets the "desired_phase" field if the given value is not nil.

func (*TaskUpdate) SetNillableInputTokens

func (tu *TaskUpdate) SetNillableInputTokens(i *int64) *TaskUpdate

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*TaskUpdate) SetNillableOutputTokens

func (tu *TaskUpdate) SetNillableOutputTokens(i *int64) *TaskUpdate

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*TaskUpdate) SetNillablePhase

func (tu *TaskUpdate) SetNillablePhase(tp *types.TaskPhase) *TaskUpdate

SetNillablePhase sets the "phase" field if the given value is not nil.

func (*TaskUpdate) SetNillableProjectDirectory

func (tu *TaskUpdate) SetNillableProjectDirectory(s *string) *TaskUpdate

SetNillableProjectDirectory sets the "project_directory" field if the given value is not nil.

func (*TaskUpdate) SetNillableTurns

func (tu *TaskUpdate) SetNillableTurns(i *int64) *TaskUpdate

SetNillableTurns sets the "turns" field if the given value is not nil.

func (*TaskUpdate) SetOutputTokens

func (tu *TaskUpdate) SetOutputTokens(i int64) *TaskUpdate

SetOutputTokens sets the "output_tokens" field.

func (*TaskUpdate) SetPhase

func (tu *TaskUpdate) SetPhase(tp types.TaskPhase) *TaskUpdate

SetPhase sets the "phase" field.

func (*TaskUpdate) SetProjectDirectory

func (tu *TaskUpdate) SetProjectDirectory(s string) *TaskUpdate

SetProjectDirectory sets the "project_directory" field.

func (*TaskUpdate) SetToolUses

func (tu *TaskUpdate) SetToolUses(m map[string]int64) *TaskUpdate

SetToolUses sets the "tool_uses" field.

func (*TaskUpdate) SetTurns

func (tu *TaskUpdate) SetTurns(i int64) *TaskUpdate

SetTurns sets the "turns" field.

func (*TaskUpdate) SetUpdateTime

func (tu *TaskUpdate) SetUpdateTime(t time.Time) *TaskUpdate

SetUpdateTime sets the "update_time" field.

func (*TaskUpdate) Where

func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where appends a list predicates to the TaskUpdate builder.

type TaskUpdateOne

type TaskUpdateOne struct {
	// contains filtered or unexported fields
}

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) AddCacheReadTokens

func (tuo *TaskUpdateOne) AddCacheReadTokens(i int64) *TaskUpdateOne

AddCacheReadTokens adds i to the "cache_read_tokens" field.

func (*TaskUpdateOne) AddCacheWriteTokens

func (tuo *TaskUpdateOne) AddCacheWriteTokens(i int64) *TaskUpdateOne

AddCacheWriteTokens adds i to the "cache_write_tokens" field.

func (*TaskUpdateOne) AddCost

func (tuo *TaskUpdateOne) AddCost(f float64) *TaskUpdateOne

AddCost adds f to the "cost" field.

func (*TaskUpdateOne) AddInputTokens

func (tuo *TaskUpdateOne) AddInputTokens(i int64) *TaskUpdateOne

AddInputTokens adds i to the "input_tokens" field.

func (*TaskUpdateOne) AddMessageIDs

func (tuo *TaskUpdateOne) AddMessageIDs(ids ...uuid.UUID) *TaskUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*TaskUpdateOne) AddMessages

func (tuo *TaskUpdateOne) AddMessages(m ...*Message) *TaskUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*TaskUpdateOne) AddOutputTokens

func (tuo *TaskUpdateOne) AddOutputTokens(i int64) *TaskUpdateOne

AddOutputTokens adds i to the "output_tokens" field.

func (*TaskUpdateOne) AddTurns

func (tuo *TaskUpdateOne) AddTurns(i int64) *TaskUpdateOne

AddTurns adds i to the "turns" field.

func (*TaskUpdateOne) ClearAgent

func (tuo *TaskUpdateOne) ClearAgent() *TaskUpdateOne

ClearAgent clears the "agent" edge to the Agent entity.

func (*TaskUpdateOne) ClearAgentID

func (tuo *TaskUpdateOne) ClearAgentID() *TaskUpdateOne

ClearAgentID clears the value of the "agent_id" field.

func (*TaskUpdateOne) ClearCacheReadTokens

func (tuo *TaskUpdateOne) ClearCacheReadTokens() *TaskUpdateOne

ClearCacheReadTokens clears the value of the "cache_read_tokens" field.

func (*TaskUpdateOne) ClearCacheWriteTokens

func (tuo *TaskUpdateOne) ClearCacheWriteTokens() *TaskUpdateOne

ClearCacheWriteTokens clears the value of the "cache_write_tokens" field.

func (*TaskUpdateOne) ClearCost

func (tuo *TaskUpdateOne) ClearCost() *TaskUpdateOne

ClearCost clears the value of the "cost" field.

func (*TaskUpdateOne) ClearDescription

func (tuo *TaskUpdateOne) ClearDescription() *TaskUpdateOne

ClearDescription clears the value of the "description" field.

func (*TaskUpdateOne) ClearInputTokens

func (tuo *TaskUpdateOne) ClearInputTokens() *TaskUpdateOne

ClearInputTokens clears the value of the "input_tokens" field.

func (*TaskUpdateOne) ClearMessages

func (tuo *TaskUpdateOne) ClearMessages() *TaskUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*TaskUpdateOne) ClearOutputTokens

func (tuo *TaskUpdateOne) ClearOutputTokens() *TaskUpdateOne

ClearOutputTokens clears the value of the "output_tokens" field.

func (*TaskUpdateOne) ClearProjectDirectory

func (tuo *TaskUpdateOne) ClearProjectDirectory() *TaskUpdateOne

ClearProjectDirectory clears the value of the "project_directory" field.

func (*TaskUpdateOne) Exec

func (tuo *TaskUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskUpdateOne) ExecX

func (tuo *TaskUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TaskUpdateOne) Modify

func (tuo *TaskUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TaskUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TaskUpdateOne) Mutation

func (tuo *TaskUpdateOne) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdateOne) RemoveMessageIDs

func (tuo *TaskUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *TaskUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*TaskUpdateOne) RemoveMessages

func (tuo *TaskUpdateOne) RemoveMessages(m ...*Message) *TaskUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*TaskUpdateOne) Save

func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated Task entity.

func (*TaskUpdateOne) SaveX

func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task

SaveX is like Save, but panics if an error occurs.

func (*TaskUpdateOne) Select

func (tuo *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TaskUpdateOne) SetAgent

func (tuo *TaskUpdateOne) SetAgent(a *Agent) *TaskUpdateOne

SetAgent sets the "agent" edge to the Agent entity.

func (*TaskUpdateOne) SetAgentID

func (tuo *TaskUpdateOne) SetAgentID(u uuid.UUID) *TaskUpdateOne

SetAgentID sets the "agent_id" field.

func (*TaskUpdateOne) SetCacheReadTokens

func (tuo *TaskUpdateOne) SetCacheReadTokens(i int64) *TaskUpdateOne

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*TaskUpdateOne) SetCacheWriteTokens

func (tuo *TaskUpdateOne) SetCacheWriteTokens(i int64) *TaskUpdateOne

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*TaskUpdateOne) SetCost

func (tuo *TaskUpdateOne) SetCost(f float64) *TaskUpdateOne

SetCost sets the "cost" field.

func (*TaskUpdateOne) SetDescription

func (tuo *TaskUpdateOne) SetDescription(s string) *TaskUpdateOne

SetDescription sets the "description" field.

func (*TaskUpdateOne) SetDesiredPhase

func (tuo *TaskUpdateOne) SetDesiredPhase(tp types.TaskPhase) *TaskUpdateOne

SetDesiredPhase sets the "desired_phase" field.

func (*TaskUpdateOne) SetInputTokens

func (tuo *TaskUpdateOne) SetInputTokens(i int64) *TaskUpdateOne

SetInputTokens sets the "input_tokens" field.

func (*TaskUpdateOne) SetNillableAgentID

func (tuo *TaskUpdateOne) SetNillableAgentID(u *uuid.UUID) *TaskUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCacheReadTokens

func (tuo *TaskUpdateOne) SetNillableCacheReadTokens(i *int64) *TaskUpdateOne

SetNillableCacheReadTokens sets the "cache_read_tokens" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCacheWriteTokens

func (tuo *TaskUpdateOne) SetNillableCacheWriteTokens(i *int64) *TaskUpdateOne

SetNillableCacheWriteTokens sets the "cache_write_tokens" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCost

func (tuo *TaskUpdateOne) SetNillableCost(f *float64) *TaskUpdateOne

SetNillableCost sets the "cost" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableDescription

func (tuo *TaskUpdateOne) SetNillableDescription(s *string) *TaskUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableDesiredPhase

func (tuo *TaskUpdateOne) SetNillableDesiredPhase(tp *types.TaskPhase) *TaskUpdateOne

SetNillableDesiredPhase sets the "desired_phase" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableInputTokens

func (tuo *TaskUpdateOne) SetNillableInputTokens(i *int64) *TaskUpdateOne

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableOutputTokens

func (tuo *TaskUpdateOne) SetNillableOutputTokens(i *int64) *TaskUpdateOne

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*TaskUpdateOne) SetNillablePhase

func (tuo *TaskUpdateOne) SetNillablePhase(tp *types.TaskPhase) *TaskUpdateOne

SetNillablePhase sets the "phase" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableProjectDirectory

func (tuo *TaskUpdateOne) SetNillableProjectDirectory(s *string) *TaskUpdateOne

SetNillableProjectDirectory sets the "project_directory" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableTurns

func (tuo *TaskUpdateOne) SetNillableTurns(i *int64) *TaskUpdateOne

SetNillableTurns sets the "turns" field if the given value is not nil.

func (*TaskUpdateOne) SetOutputTokens

func (tuo *TaskUpdateOne) SetOutputTokens(i int64) *TaskUpdateOne

SetOutputTokens sets the "output_tokens" field.

func (*TaskUpdateOne) SetPhase

func (tuo *TaskUpdateOne) SetPhase(tp types.TaskPhase) *TaskUpdateOne

SetPhase sets the "phase" field.

func (*TaskUpdateOne) SetProjectDirectory

func (tuo *TaskUpdateOne) SetProjectDirectory(s string) *TaskUpdateOne

SetProjectDirectory sets the "project_directory" field.

func (*TaskUpdateOne) SetToolUses

func (tuo *TaskUpdateOne) SetToolUses(m map[string]int64) *TaskUpdateOne

SetToolUses sets the "tool_uses" field.

func (*TaskUpdateOne) SetTurns

func (tuo *TaskUpdateOne) SetTurns(i int64) *TaskUpdateOne

SetTurns sets the "turns" field.

func (*TaskUpdateOne) SetUpdateTime

func (tuo *TaskUpdateOne) SetUpdateTime(t time.Time) *TaskUpdateOne

SetUpdateTime sets the "update_time" field.

func (*TaskUpdateOne) Where

func (tuo *TaskUpdateOne) Where(ps ...predicate.Task) *TaskUpdateOne

Where appends a list predicates to the TaskUpdate builder.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Agent is the client for interacting with the Agent builders.
	Agent *AgentClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Model is the client for interacting with the Model builders.
	Model *ModelClient
	// ModelProvider is the client for interacting with the ModelProvider builders.
	ModelProvider *ModelProviderClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL