Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompletionRequest ¶
type CompletionRequest struct {
Prefix string // Code before the cursor
Suffix string // Code after the cursor
Language string // Language ID (e.g., "go", "typescript")
FilePath string // File being edited
MaxTokens int // Max tokens to generate (default 128 if 0)
}
CompletionRequest holds the context for a code completion request.
type CompletionResult ¶
CompletionResult contains the generated completion.
func GenerateCompletion ¶
func GenerateCompletion(ctx context.Context, client api.ClientInterface, req CompletionRequest) (*CompletionResult, error)
GenerateCompletion generates a code completion using chat-formatted FIM.
The caller's context is honored (e.g. r.Context() from an HTTP handler) so that an aborted request cancels the in-flight LLM call; a timeout is layered on top to bound total generation time.
Click to show internal directories.
Click to hide internal directories.