Files

83 lines
1.9 KiB
Go

package domain
type AIInvocationRequest struct {
RequestID string
PluginID string
RouteKey string
ServerInstanceID string
Purpose string
ProviderID string
Model string
Prompt string
CurrentConfig string
ContextRefs map[string]string
}
type AIInvocationUsage struct {
ProviderID string
Model string
InputTokens int
OutputTokens int
Mocked bool
}
type AIConfigRecommendation struct {
Key string
SuggestedConfig string
DiffSummary string
}
type AIConfigExecution struct {
Status string
Job Job
}
type AIInvocationSafeError struct {
Code string
Message string
Details []string
}
type AIInvocationResponse struct {
RequestID string
Purpose string
ProviderID string
Model string
Status string
Recommendation string
ConfigRecommendation *AIConfigRecommendation
ConfigExecution *AIConfigExecution
Usage AIInvocationUsage
Error *AIInvocationSafeError
}
type AIProviderInvocationResult struct {
Recommendation string
SuggestedConfig string
Usage AIInvocationUsage
Error *AIInvocationSafeError
}
func CopyAIInvocationRequest(request AIInvocationRequest) AIInvocationRequest {
request.ContextRefs = CopyStringMap(request.ContextRefs)
return request
}
func CopyAIInvocationResponse(response AIInvocationResponse) AIInvocationResponse {
if response.ConfigRecommendation != nil {
recommendation := *response.ConfigRecommendation
response.ConfigRecommendation = &recommendation
}
if response.ConfigExecution != nil {
execution := *response.ConfigExecution
execution.Job = CopyJob(execution.Job)
response.ConfigExecution = &execution
}
if response.Error != nil {
errorCopy := *response.Error
errorCopy.Details = CopyStringSlice(errorCopy.Details)
response.Error = &errorCopy
}
return response
}