grpc

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 1 Imported by: 0

README

internal/grpc — optional gRPC server

The transport is enabled with the grpc build tag. It uses Eyrie's small Go request/response structs with the registered json gRPC content subtype, which avoids generated protobuf code while retaining gRPC framing, interceptors, deadlines, status propagation, and HTTP/2 transport.

  • grpc.go defines the transport-independent ChatService contract.
  • server_grpc.go registers and serves eyrie.v1.ChatService/Chat.
  • Clients must select grpc.CallContentSubtype("json").

Running

go build -tags grpc ./...

Callers provide a ChatService implementation to Serve or NewServer. The untagged build retains only the service contract, so consumers that do not need a network server do not link the gRPC runtime.

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

View Source
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

type ChatRequest struct {
	Model        string
	SystemPrompt string
	Message      string
	MaxTokens    int
}

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

type ChatResponse struct {
	Content      string
	NodeID       string
	FinishReason string
}

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.

Jump to

Keyboard shortcuts

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