first commit

This commit is contained in:
npc0-hue
2026-07-11 14:56:10 +08:00
commit 7e05d0a4e7
660 changed files with 78119 additions and 0 deletions
+71
View File
@@ -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
}