Move embedded prompts to PromptKit definitions
This commit is contained in:
@@ -2,22 +2,18 @@ package contracts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/chunking"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/config"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/schema"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/proposals"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/responseschema"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/structuredoutput"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/validators"
|
||||
stagewarnings "gitea.maximumdirect.net/eric/audita/internal/framework/warnings"
|
||||
)
|
||||
|
||||
// StructuredLLMClient provides provider-agnostic structured completion.
|
||||
type StructuredLLMClient interface {
|
||||
CompleteStructured(ctx context.Context, req StructuredCompletionRequest, out any) (StructuredCompletionResponse, error)
|
||||
}
|
||||
type StructuredLLMClient = structuredoutput.Client
|
||||
|
||||
// LLMScheduler provides bounded execution for LLM call sites.
|
||||
type LLMScheduler interface {
|
||||
@@ -38,29 +34,8 @@ type Validator interface {
|
||||
Validate(ctx context.Context, req ValidationRequest) (validators.Result, error)
|
||||
}
|
||||
|
||||
// StructuredCompletionRequest is a transport-neutral structured completion request.
|
||||
type StructuredCompletionRequest struct {
|
||||
StageName string `json:"stage_name"`
|
||||
Messages []LLMMessage `json:"messages"`
|
||||
Model string `json:"model,omitempty"`
|
||||
ResponseSchema *responseschema.Schema `json:"response_schema,omitempty"`
|
||||
}
|
||||
|
||||
// StructuredCompletionResponse is a transport-neutral structured completion response payload.
|
||||
type StructuredCompletionResponse struct {
|
||||
Content json.RawMessage `json:"content"`
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Model string `json:"model,omitempty"`
|
||||
PromptTokens int `json:"prompt_tokens,omitempty"`
|
||||
CompletionTokens int `json:"completion_tokens,omitempty"`
|
||||
TotalTokens int `json:"total_tokens,omitempty"`
|
||||
}
|
||||
|
||||
// LLMMessage is a minimal chat message shape for LLM prompts.
|
||||
type LLMMessage struct {
|
||||
Role string `json:"role"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
type StructuredCompletionRequest = structuredoutput.Request
|
||||
type StructuredCompletionResponse = structuredoutput.Response
|
||||
|
||||
// ModuleRunSpec identifies one resolved module instance in a pipeline.
|
||||
type ModuleRunSpec struct {
|
||||
|
||||
Reference in New Issue
Block a user