Documentation ¶
Index ¶
- Constants
- Variables
- func GinContextFromContext(ctx context.Context) (*gin.Context, error)
- func GinContextToContextMiddleware() gin.HandlerFunc
- func IsGetFailError(err error) bool
- func IsTypeError(err error) bool
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func PlaygroundHandler() gin.HandlerFunc
- func QueryHandler() gin.HandlerFunc
- type Action
- type ActionKind
- type AuthInput
- type Character
- type ComplexityRoot
- type Config
- type Conversation
- type ConversationMeta
- type DirectiveRoot
- type GPT3Resolver
- type GetFailError
- type InfoPair
- type MessageEditInput
- type MessageInput
- type Mutation
- func (m Mutation) Delete(_ context.Context, conversationID uid.ID, messageID *uid.ID) (bool, error)
- func (m Mutation) EditMessage(_ context.Context, conversationID uid.ID, messageID uid.ID, ...) (bool, error)
- func (m Mutation) NewConversation(ctx context.Context, scenarioID uid.ID) (*uid.ID, error)
- func (m Mutation) NewMessage(_ context.Context, conversationID uid.ID, message MessageInput) (bool, error)
- func (m Mutation) TriggerAction(_ context.Context, conversationID uid.ID, actionID uid.ID) (bool, error)
- type MutationResolver
- type Query
- type QueryResolver
- type ResolverRoot
- type Root
- type Scenario
- type ScenarioMeta
- type ServerMeta
- type TypeError
- type User
Constants ¶
View Source
const GinContextKey = "GinContextKey"
View Source
const PlaygroundEndpoint = "/graphql/playground"
View Source
const QueryEndpoint = "/graphql/query"
Variables ¶
View Source
var AllActionKind = []ActionKind{ ActionKindTopicChange, ActionKindConversationEnd, }
View Source
var Engine *types.Engine
Functions ¶
func GinContextToContextMiddleware ¶
func GinContextToContextMiddleware() gin.HandlerFunc
func IsGetFailError ¶
func IsTypeError ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func PlaygroundHandler ¶
func PlaygroundHandler() gin.HandlerFunc
func QueryHandler ¶
func QueryHandler() gin.HandlerFunc
Types ¶
type Action ¶
type Action struct { ID uid.ID `json:"id"` Kind ActionKind `json:"kind"` Label string `json:"label"` }
type ActionKind ¶
type ActionKind string
const ( ActionKindTopicChange ActionKind = "TOPIC_CHANGE" ActionKindConversationEnd ActionKind = "CONVERSATION_END" )
func (ActionKind) IsValid ¶
func (e ActionKind) IsValid() bool
func (ActionKind) MarshalGQL ¶
func (e ActionKind) MarshalGQL(w io.Writer)
func (ActionKind) String ¶
func (e ActionKind) String() string
func (*ActionKind) UnmarshalGQL ¶
func (e *ActionKind) UnmarshalGQL(v interface{}) error
type ComplexityRoot ¶
type ComplexityRoot struct { Action struct { ID func(childComplexity int) int Kind func(childComplexity int) int Label func(childComplexity int) int } Character struct { Anonymous func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Type func(childComplexity int) int } Conversation struct { Actions func(childComplexity int) int Characters func(childComplexity int) int Gpt3 func(childComplexity int) int ID func(childComplexity int) int Messages func(childComplexity int) int Meta func(childComplexity int) int Scenario func(childComplexity int) int Status func(childComplexity int) int } ConversationMeta struct { Active func(childComplexity int) int Engine func(childComplexity int) int Started func(childComplexity int) int Timeout func(childComplexity int) int User func(childComplexity int) int } Gpt3 struct { Engine func(childComplexity int) int FrequencyPenalty func(childComplexity int) int MaxTokens func(childComplexity int) int PresencePenalty func(childComplexity int) int ResponseLength func(childComplexity int) int SummarizeToken func(childComplexity int) int Temperature func(childComplexity int) int TopP func(childComplexity int) int } InfoPair struct { Key func(childComplexity int) int Value func(childComplexity int) int } Message struct { EditableTo func(childComplexity int) int From func(childComplexity int) int ID func(childComplexity int) int VisibleTo func(childComplexity int) int } Mutation struct { Delete func(childComplexity int, conversationID uid.ID, messageID *uid.ID) int EditMessage func(childComplexity int, conversationID uid.ID, messageID uid.ID, message MessageEditInput) int NewConversation func(childComplexity int, scenarioID uid.ID) int NewMessage func(childComplexity int, conversationID uid.ID, message MessageInput) int TriggerAction func(childComplexity int, conversationID uid.ID, actionID uid.ID) int } Query struct { Conversations func(childComplexity int, ids []uid.ID) int Meta func(childComplexity int) int Scenario func(childComplexity int, ids []uid.ID) int } Scenario struct { Characters func(childComplexity int) int Gpt3 func(childComplexity int) int ID func(childComplexity int) int Info func(childComplexity int) int Messages func(childComplexity int) int Meta func(childComplexity int) int } ScenarioMeta struct { Description func(childComplexity int) int Duration func(childComplexity int) int Level func(childComplexity int) int Title func(childComplexity int) int } ServerMeta struct { Authors func(childComplexity int) int GinMode func(childComplexity int) int GinVersion func(childComplexity int) int Hash func(childComplexity int) int Name func(childComplexity int) int Version func(childComplexity int) int } User struct { Allow func(childComplexity int) int Block func(childComplexity int) int ID func(childComplexity int) int Jwt func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type Conversation ¶
type Conversation struct { ID uid.ID `json:"id"` Meta *ConversationMeta `json:"meta"` Messages []*types.Msg `json:"messages"` Scenario *Scenario `json:"scenario"` Actions []*Action `json:"actions"` Characters []*Character `json:"characters"` Gpt3 *types.GPT3 `json:"gpt3"` Status *string `json:"status"` }
type ConversationMeta ¶
type DirectiveRoot ¶
type DirectiveRoot struct { }
type GPT3Resolver ¶
type GPT3Resolver interface { Temperature(ctx context.Context, obj *types.GPT3) (float64, error) TopP(ctx context.Context, obj *types.GPT3) (float64, error) FrequencyPenalty(ctx context.Context, obj *types.GPT3) (float64, error) PresencePenalty(ctx context.Context, obj *types.GPT3) (float64, error) }
type GetFailError ¶
type GetFailError struct{}
func (GetFailError) Error ¶
func (g GetFailError) Error() string
type MessageEditInput ¶
type MessageInput ¶
type Mutation ¶
type Mutation struct{}
func (Mutation) EditMessage ¶
func (Mutation) NewConversation ¶
func (Mutation) NewMessage ¶
type MutationResolver ¶
type MutationResolver interface { NewConversation(ctx context.Context, scenarioID uid.ID) (*uid.ID, error) Delete(ctx context.Context, conversationID uid.ID, messageID *uid.ID) (bool, error) TriggerAction(ctx context.Context, conversationID uid.ID, actionID uid.ID) (bool, error) NewMessage(ctx context.Context, conversationID uid.ID, message MessageInput) (bool, error) EditMessage(ctx context.Context, conversationID uid.ID, messageID uid.ID, message MessageEditInput) (bool, error) }
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface { GPT3() GPT3Resolver Mutation() MutationResolver Query() QueryResolver }
type Root ¶
type Root struct{}
func (Root) GPT3 ¶
func (r Root) GPT3() GPT3Resolver
func (Root) Mutation ¶
func (r Root) Mutation() MutationResolver
func (Root) Query ¶
func (r Root) Query() QueryResolver
type ScenarioMeta ¶
type ServerMeta ¶
type ServerMeta struct { GinMode string `json:"gin_mode"` Hash *string `json:"hash"` Version *string `json:"version"` GinVersion string `json:"gin_version"` Name string `json:"name"` Authors []string `json:"authors"` }
func NewServerMeta ¶
func NewServerMeta() ServerMeta
Click to show internal directories.
Click to hide internal directories.