first commit
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
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 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
|
||||
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.Error != nil {
|
||||
errorCopy := *response.Error
|
||||
errorCopy.Details = CopyStringSlice(errorCopy.Details)
|
||||
response.Error = &errorCopy
|
||||
}
|
||||
return response
|
||||
}
|
||||
Reference in New Issue
Block a user