Documentation
¶
Overview ¶
Package debug is the debug mode: which models serve the calls of AI of a task from paper, past the admission list, and what every call of a model made for the account returned and cost — of a task from paper, of a task of a module, of an essay, of the tutor's words, of grown-up mode —, for an account with the right of the mode. The choice serves a task from paper alone, where the author compares models; the record is of every call, so that the cost of a session is all it spent. Its choice and its calls are each account's, in the memory of the process alone: nothing of them goes to the log or to the database. api makes a Store on a run whose tutor has its own adapters with the key of Anthropic, on a deployment too.
Index ¶
- Variables
- func Models() []*v1.DebugModel
- type Action
- type Service
- func (s *Service) GetDebug(ctx context.Context, _ *v1.GetDebugRequest) (*v1.GetDebugResponse, error)
- func (s *Service) SetDebugModels(ctx context.Context, req *v1.SetDebugModelsRequest) (*v1.SetDebugModelsResponse, error)
- func (s *Service) TakeDebugCalls(ctx context.Context, _ *v1.TakeDebugCallsRequest) (*v1.TakeDebugCallsResponse, error)
- type Store
- func (s *Store) Begin(accountID string, kind v1.DebugActionKind, attemptID string, at time.Time) *Action
- func (s *Store) Choice(accountID string) *v1.DebugChoice
- func (s *Store) Chosen(accountID string) bool
- func (s *Store) Open(c rpc.Caller) bool
- func (s *Store) SetChoice(accountID string, c *v1.DebugChoice) (*v1.DebugChoice, error)
- func (s *Store) Take(accountID string) []*v1.DebugAction
Constants ¶
This section is empty.
Variables ¶
var ErrChoice = errors.New("debug: not a choice of the models")
ErrChoice is a choice of a model the catalog does not name, an effort it does not take, or thinking off where the model or the effort keeps it on.
Functions ¶
func Models ¶
func Models() []*v1.DebugModel
Models are the models that can be chosen: tutor's catalog of Claude, cheapest first.
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action is one request that may call a model while it runs: the route it gives tutor, and the calls it records. A nil Action, of a run without the mode or an account without its right, records nothing and leaves a route as it is.
func (*Action) Chosen ¶
Chosen is whether the action has a first model, by which tutor takes a call the admission list refuses.
type Service ¶
type Service struct {
apiv1connect.UnimplementedDebugServiceHandler
// contains filtered or unexported fields
}
Service is the DebugService of a Store: api registers it on a run with a Store, and without one each method answers unimplemented.
func NewService ¶
NewService is the DebugService of s, whose admitted gives the models the admission list gives a call for an adult on platform AI, in their order.
func (*Service) GetDebug ¶
func (s *Service) GetDebug(ctx context.Context, _ *v1.GetDebugRequest) (*v1.GetDebugResponse, error)
GetDebug gives the models that can be chosen and the account's choice.
func (*Service) SetDebugModels ¶
func (s *Service) SetDebugModels(ctx context.Context, req *v1.SetDebugModelsRequest) (*v1.SetDebugModelsResponse, error)
SetDebugModels sets the account's choice, or refuses one the models do not take with invalid_argument.
func (*Service) TakeDebugCalls ¶
func (s *Service) TakeDebugCalls(ctx context.Context, _ *v1.TakeDebugCallsRequest) (*v1.TakeDebugCallsResponse, error)
TakeDebugCalls gives the account's actions since the last take and forgets them.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the choice and the actions of each account.
func New ¶
New is a Store with no choice: each call has its model of the list. every gives every account the right of the mode.
func (*Store) Begin ¶
func (s *Store) Begin(accountID string, kind v1.DebugActionKind, attemptID string, at time.Time) *Action
Begin is an action of the account by its choice now; a nil Store begins none.
func (*Store) Choice ¶
func (s *Store) Choice(accountID string) *v1.DebugChoice
Choice is the account's choice now: its first model alone, since the Check is one call of one model and has no second.
func (*Store) Chosen ¶
Chosen is whether the account has a first model, which bypasses the admission list as tutor does; a nil Store has none.
func (*Store) Open ¶ added in v0.1.74
Open says whether the mode is open to the caller: an account whose row has the right, or any account of a store that gives it to every one. A nil Store, of a run without the mode, opens it to none.
func (*Store) SetChoice ¶
func (s *Store) SetChoice(accountID string, c *v1.DebugChoice) (*v1.DebugChoice, error)
SetChoice sets the account's choice, from its next action on. A second model is not read: the Check has no second reader.