prompt

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthPrompt        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPrompt          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPrompt = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterPromptServer

func RegisterPromptServer(s *grpc.Server, srv PromptServer)

Types

type BoolRequest

type BoolRequest struct {
	// the prompt to display to the user
	Prompt string `protobuf:"bytes,1,opt,name=prompt,proto3" json:"prompt,omitempty"`
	// if provided, the prompt will be persisted and not reprompted
	PersistentKey string `protobuf:"bytes,2,opt,name=persistentKey,proto3" json:"persistentKey,omitempty"`
	// the default value to return if the user doesn't respond
	Default bool `protobuf:"varint,3,opt,name=default,proto3" json:"default,omitempty"`
	// a (very) brief title for the prompt
	Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
}

func (*BoolRequest) Descriptor

func (*BoolRequest) Descriptor() ([]byte, []int)

func (*BoolRequest) Equal

func (this *BoolRequest) Equal(that interface{}) bool

func (*BoolRequest) GetDefault

func (m *BoolRequest) GetDefault() bool

func (*BoolRequest) GetPersistentKey

func (m *BoolRequest) GetPersistentKey() string

func (*BoolRequest) GetPrompt

func (m *BoolRequest) GetPrompt() string

func (*BoolRequest) GetTitle added in v0.18.18

func (m *BoolRequest) GetTitle() string

func (*BoolRequest) GoString

func (this *BoolRequest) GoString() string

func (*BoolRequest) Marshal

func (m *BoolRequest) Marshal() (dAtA []byte, err error)

func (*BoolRequest) MarshalTo

func (m *BoolRequest) MarshalTo(dAtA []byte) (int, error)

func (*BoolRequest) MarshalToSizedBuffer

func (m *BoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BoolRequest) ProtoMessage

func (*BoolRequest) ProtoMessage()

func (*BoolRequest) Reset

func (m *BoolRequest) Reset()

func (*BoolRequest) Size

func (m *BoolRequest) Size() (n int)

func (*BoolRequest) String

func (this *BoolRequest) String() string

func (*BoolRequest) Unmarshal

func (m *BoolRequest) Unmarshal(dAtA []byte) error

func (*BoolRequest) XXX_DiscardUnknown

func (m *BoolRequest) XXX_DiscardUnknown()

func (*BoolRequest) XXX_Marshal

func (m *BoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BoolRequest) XXX_Merge

func (m *BoolRequest) XXX_Merge(src proto.Message)

func (*BoolRequest) XXX_Size

func (m *BoolRequest) XXX_Size() int

func (*BoolRequest) XXX_Unmarshal

func (m *BoolRequest) XXX_Unmarshal(b []byte) error

type BoolResponse

type BoolResponse struct {
	// the response from the user
	Response bool `protobuf:"varint,1,opt,name=response,proto3" json:"response,omitempty"`
}

func (*BoolResponse) Descriptor

func (*BoolResponse) Descriptor() ([]byte, []int)

func (*BoolResponse) Equal

func (this *BoolResponse) Equal(that interface{}) bool

func (*BoolResponse) GetResponse

func (m *BoolResponse) GetResponse() bool

func (*BoolResponse) GoString

func (this *BoolResponse) GoString() string

func (*BoolResponse) Marshal

func (m *BoolResponse) Marshal() (dAtA []byte, err error)

func (*BoolResponse) MarshalTo

func (m *BoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*BoolResponse) MarshalToSizedBuffer

func (m *BoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BoolResponse) ProtoMessage

func (*BoolResponse) ProtoMessage()

func (*BoolResponse) Reset

func (m *BoolResponse) Reset()

func (*BoolResponse) Size

func (m *BoolResponse) Size() (n int)

func (*BoolResponse) String

func (this *BoolResponse) String() string

func (*BoolResponse) Unmarshal

func (m *BoolResponse) Unmarshal(dAtA []byte) error

func (*BoolResponse) XXX_DiscardUnknown

func (m *BoolResponse) XXX_DiscardUnknown()

func (*BoolResponse) XXX_Marshal

func (m *BoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BoolResponse) XXX_Merge

func (m *BoolResponse) XXX_Merge(src proto.Message)

func (*BoolResponse) XXX_Size

func (m *BoolResponse) XXX_Size() int

func (*BoolResponse) XXX_Unmarshal

func (m *BoolResponse) XXX_Unmarshal(b []byte) error

type PromptAttachable

type PromptAttachable struct {
	UnimplementedPromptServer
	// contains filtered or unexported fields
}

func NewPromptAttachable

func NewPromptAttachable(promptHandler PromptHandler) PromptAttachable

func (PromptAttachable) PromptBool

func (p PromptAttachable) PromptBool(ctx context.Context, req *BoolRequest) (*BoolResponse, error)

func (PromptAttachable) PromptString

func (p PromptAttachable) PromptString(ctx context.Context, req *StringRequest) (*StringResponse, error)

func (PromptAttachable) Register

func (p PromptAttachable) Register(srv *grpc.Server)

type PromptClient

type PromptClient interface {
	PromptBool(ctx context.Context, in *BoolRequest, opts ...grpc.CallOption) (*BoolResponse, error)
	PromptString(ctx context.Context, in *StringRequest, opts ...grpc.CallOption) (*StringResponse, error)
}

PromptClient is the client API for Prompt service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPromptClient

func NewPromptClient(cc *grpc.ClientConn) PromptClient

type PromptHandler

type PromptHandler interface {
	HandlePrompt(ctx context.Context, title, prompt string, dest any) error
	HandleForm(ctx context.Context, form *huh.Form) error
}

type PromptResponses

type PromptResponses struct {
	// only keyed like this for json marshalling forwards-compatibility
	Responses map[string]struct{} `json:"responses"`
}

PromptResponses manages the list of LLM modules that the user has allowed

type PromptServer

type PromptServer interface {
	PromptBool(context.Context, *BoolRequest) (*BoolResponse, error)
	PromptString(context.Context, *StringRequest) (*StringResponse, error)
}

PromptServer is the server API for Prompt service.

type StringRequest

type StringRequest struct {
	// the prompt to display to the user
	Prompt string `protobuf:"bytes,1,opt,name=prompt,proto3" json:"prompt,omitempty"`
	// the default value to return if the user doesn't respond
	Default string `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"`
	// a (very) brief title for the prompt
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
}

func (*StringRequest) Descriptor

func (*StringRequest) Descriptor() ([]byte, []int)

func (*StringRequest) Equal

func (this *StringRequest) Equal(that interface{}) bool

func (*StringRequest) GetDefault

func (m *StringRequest) GetDefault() string

func (*StringRequest) GetPrompt

func (m *StringRequest) GetPrompt() string

func (*StringRequest) GetTitle added in v0.18.18

func (m *StringRequest) GetTitle() string

func (*StringRequest) GoString

func (this *StringRequest) GoString() string

func (*StringRequest) Marshal

func (m *StringRequest) Marshal() (dAtA []byte, err error)

func (*StringRequest) MarshalTo

func (m *StringRequest) MarshalTo(dAtA []byte) (int, error)

func (*StringRequest) MarshalToSizedBuffer

func (m *StringRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StringRequest) ProtoMessage

func (*StringRequest) ProtoMessage()

func (*StringRequest) Reset

func (m *StringRequest) Reset()

func (*StringRequest) Size

func (m *StringRequest) Size() (n int)

func (*StringRequest) String

func (this *StringRequest) String() string

func (*StringRequest) Unmarshal

func (m *StringRequest) Unmarshal(dAtA []byte) error

func (*StringRequest) XXX_DiscardUnknown

func (m *StringRequest) XXX_DiscardUnknown()

func (*StringRequest) XXX_Marshal

func (m *StringRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StringRequest) XXX_Merge

func (m *StringRequest) XXX_Merge(src proto.Message)

func (*StringRequest) XXX_Size

func (m *StringRequest) XXX_Size() int

func (*StringRequest) XXX_Unmarshal

func (m *StringRequest) XXX_Unmarshal(b []byte) error

type StringResponse

type StringResponse struct {
	// the response from the user
	Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
}

func (*StringResponse) Descriptor

func (*StringResponse) Descriptor() ([]byte, []int)

func (*StringResponse) Equal

func (this *StringResponse) Equal(that interface{}) bool

func (*StringResponse) GetResponse

func (m *StringResponse) GetResponse() string

func (*StringResponse) GoString

func (this *StringResponse) GoString() string

func (*StringResponse) Marshal

func (m *StringResponse) Marshal() (dAtA []byte, err error)

func (*StringResponse) MarshalTo

func (m *StringResponse) MarshalTo(dAtA []byte) (int, error)

func (*StringResponse) MarshalToSizedBuffer

func (m *StringResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StringResponse) ProtoMessage

func (*StringResponse) ProtoMessage()

func (*StringResponse) Reset

func (m *StringResponse) Reset()

func (*StringResponse) Size

func (m *StringResponse) Size() (n int)

func (*StringResponse) String

func (this *StringResponse) String() string

func (*StringResponse) Unmarshal

func (m *StringResponse) Unmarshal(dAtA []byte) error

func (*StringResponse) XXX_DiscardUnknown

func (m *StringResponse) XXX_DiscardUnknown()

func (*StringResponse) XXX_Marshal

func (m *StringResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StringResponse) XXX_Merge

func (m *StringResponse) XXX_Merge(src proto.Message)

func (*StringResponse) XXX_Size

func (m *StringResponse) XXX_Size() int

func (*StringResponse) XXX_Unmarshal

func (m *StringResponse) XXX_Unmarshal(b []byte) error

type UnimplementedPromptServer

type UnimplementedPromptServer struct {
}

UnimplementedPromptServer can be embedded to have forward compatible implementations.

func (*UnimplementedPromptServer) PromptBool

func (*UnimplementedPromptServer) PromptString

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL