Documentation
¶
Overview ¶
Package grpc holds a dependency-free skeleton for an eyrie gRPC API.
eyrie does not currently import google.golang.org/grpc, and per repo policy that dependency is not added speculatively. This file therefore defines only the service contract and a no-op default implementation so the rest of the codebase can reference the gRPC surface today. The real server wiring lives in server_grpc.go behind the "grpc" build tag. See README.md for the design note and codegen steps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnimplemented = errUnimplemented{}
ErrUnimplemented is returned by the default ChatService until a real gRPC-backed implementation is provided.
When google.golang.org/grpc and the generated protobuf stubs are added (see README.md), replace noopChatService with an engine-backed adapter and register it via server_grpc.go (build tag "grpc").
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
ChatRequest is the unary Chat request payload. It mirrors the HTTP /prompt request fields so a gRPC implementation can reuse the conversation engine without translation.
type ChatResponse ¶
ChatResponse is the unary Chat response payload.
type ChatService ¶
type ChatService interface {
Chat(ctx context.Context, req *ChatRequest) (*ChatResponse, error)
}
ChatService is the eyrie gRPC service contract: a single unary Chat RPC. A concrete implementation will adapt conversation.Engine; see README.md.
func NewChatService ¶
func NewChatService() ChatService
NewChatService returns the default (no-op) ChatService. It exists so callers have a stable constructor; once a real backend exists this will return the engine-backed implementation instead.
func NewEngineChatService ¶ added in v0.6.0
func NewEngineChatService(engine *conversation.Engine) ChatService
NewEngineChatService returns a ChatService backed by a conversation.Engine. It is the real backend referenced by the gRPC server (build tag "grpc").
type EngineChatService ¶ added in v0.6.0
type EngineChatService struct {
// contains filtered or unexported fields
}
EngineChatService adapts conversation.Engine to the ChatService contract: a unary Chat RPC becomes a single Prompt over the conversation engine, with the streamed assistant content aggregated into the response.
func (*EngineChatService) Chat ¶ added in v0.6.0
func (s *EngineChatService) Chat(ctx context.Context, req *ChatRequest) (*ChatResponse, error)
Chat runs a single prompt through the conversation engine and aggregates the streamed assistant content into a ChatResponse.