Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

178 rindas
7.6KB

  1. package domain
  2. import (
  3. "encoding/json"
  4. "time"
  5. )
  6. type Template struct {
  7. ID int64 `json:"id"`
  8. Name string `json:"name"`
  9. Description string `json:"description"`
  10. Locale string `json:"locale"`
  11. ThumbnailURL string `json:"thumbnailUrl"`
  12. TemplatePreviewURL string `json:"templatePreviewUrl"`
  13. Type string `json:"type"`
  14. PaletteReady bool `json:"paletteReady"`
  15. RawJSON json.RawMessage `json:"rawTemplateJson"`
  16. IsAITemplate bool `json:"isAiTemplate"`
  17. IsOnboarded bool `json:"isOnboarded"`
  18. ManifestStatus string `json:"manifestStatus"`
  19. LastDiscoveredAt *time.Time `json:"lastDiscoveredAt,omitempty"`
  20. }
  21. type TemplateManifest struct {
  22. ID string `json:"id"`
  23. TemplateID int64 `json:"templateId"`
  24. Version int `json:"version"`
  25. Source string `json:"source"`
  26. LanguageUsedDiscovery string `json:"languageUsedForDiscovery"`
  27. DiscoveryPayloadJSON json.RawMessage `json:"discoveryPayloadJson"`
  28. DiscoveryResponseJSON json.RawMessage `json:"discoveryResponseJson"`
  29. FlattenedManifestJSON json.RawMessage `json:"flattenedManifestJson"`
  30. IsActive bool `json:"isActive"`
  31. CreatedAt time.Time `json:"createdAt"`
  32. UpdatedAt time.Time `json:"updatedAt"`
  33. }
  34. type TemplateField struct {
  35. ID string `json:"id"`
  36. TemplateID int64 `json:"templateId"`
  37. ManifestID string `json:"manifestId"`
  38. Section string `json:"section"`
  39. WebsiteSection string `json:"websiteSection"`
  40. KeyName string `json:"keyName"`
  41. Path string `json:"path"`
  42. FieldKind string `json:"fieldKind"`
  43. SampleValue string `json:"sampleValue"`
  44. IsEnabled bool `json:"isEnabled"`
  45. IsRequiredByUs bool `json:"isRequiredByUs"`
  46. DisplayLabel string `json:"displayLabel"`
  47. DisplayOrder int `json:"displayOrder"`
  48. Notes string `json:"notes"`
  49. SemanticSlot string `json:"semanticSlot,omitempty"`
  50. MappingSource string `json:"mappingSource,omitempty"`
  51. MappingConfidence float64 `json:"mappingConfidence,omitempty"`
  52. }
  53. const (
  54. MappingSourceRule = "rule"
  55. MappingSourceAI = "ai"
  56. MappingSourceManual = "manual"
  57. )
  58. type SiteBuild struct {
  59. ID string `json:"id"`
  60. TemplateID int64 `json:"templateId"`
  61. ManifestID string `json:"manifestId"`
  62. RequestName string `json:"requestName"`
  63. GlobalDataJSON json.RawMessage `json:"globalDataJson"`
  64. AIDataJSON json.RawMessage `json:"aiDataJson"`
  65. FinalSitesPayload json.RawMessage `json:"finalSitesPayloadJson"`
  66. QCJobID *int64 `json:"qcJobId,omitempty"`
  67. QCSiteID *int64 `json:"qcSiteId,omitempty"`
  68. QCStatus string `json:"qcStatus"`
  69. QCPreviewURL string `json:"qcPreviewUrl"`
  70. QCEditorURL string `json:"qcEditorUrl"`
  71. QCResultJSON json.RawMessage `json:"qcResultJson"`
  72. QCErrorJSON json.RawMessage `json:"qcErrorJson"`
  73. StartedAt *time.Time `json:"startedAt,omitempty"`
  74. FinishedAt *time.Time `json:"finishedAt,omitempty"`
  75. }
  76. type BuildDraft struct {
  77. ID string `json:"id"`
  78. TemplateID int64 `json:"templateId"`
  79. ManifestID string `json:"manifestId"`
  80. Source string `json:"source"`
  81. RequestName string `json:"requestName"`
  82. GlobalDataJSON json.RawMessage `json:"globalDataJson"`
  83. FieldValuesJSON json.RawMessage `json:"fieldValuesJson"`
  84. DraftContextJSON json.RawMessage `json:"draftContextJson"`
  85. SuggestionStateJSON json.RawMessage `json:"suggestionStateJson"`
  86. Status string `json:"status"`
  87. Notes string `json:"notes"`
  88. CreatedAt time.Time `json:"createdAt"`
  89. UpdatedAt time.Time `json:"updatedAt"`
  90. }
  91. const (
  92. DraftSuggestionSourceLLM = "llm"
  93. DraftSuggestionSourceQCLLM = "qc-llm"
  94. DraftSuggestionSourceFallbackRuleBased = "fallback-rule-based"
  95. DraftSuggestionSourceRuleBased = DraftSuggestionSourceFallbackRuleBased
  96. DraftSuggestionStatusSuggested = "suggested"
  97. DraftSuggestionStatusApplied = "applied"
  98. DraftSuggestionStatusDismissed = "dismissed"
  99. )
  100. type DraftSuggestion struct {
  101. FieldPath string `json:"fieldPath"`
  102. Slot string `json:"slot,omitempty"`
  103. Value string `json:"value"`
  104. Reason string `json:"reason,omitempty"`
  105. Source string `json:"source,omitempty"`
  106. Status string `json:"status,omitempty"`
  107. GeneratedAt time.Time `json:"generatedAt,omitempty"`
  108. UpdatedAt time.Time `json:"updatedAt,omitempty"`
  109. }
  110. type DraftSuggestionState struct {
  111. ByFieldPath map[string]DraftSuggestion `json:"byFieldPath,omitempty"`
  112. UpdatedAt time.Time `json:"updatedAt,omitempty"`
  113. }
  114. type DraftStyleProfile struct {
  115. LocaleStyle string `json:"localeStyle,omitempty"`
  116. MarketStyle string `json:"marketStyle,omitempty"`
  117. AddressMode string `json:"addressMode,omitempty"`
  118. ContentTone string `json:"contentTone,omitempty"`
  119. PromptInstructions string `json:"promptInstructions,omitempty"`
  120. }
  121. type PromptBlockConfig struct {
  122. ID string `json:"id"`
  123. Label string `json:"label,omitempty"`
  124. Instruction string `json:"instruction,omitempty"`
  125. Enabled bool `json:"enabled"`
  126. }
  127. type DraftPromptConfig struct {
  128. Blocks []PromptBlockConfig `json:"blocks,omitempty"`
  129. }
  130. type DraftLLMContext struct {
  131. BusinessType string `json:"businessType,omitempty"`
  132. WebsiteURL string `json:"websiteUrl,omitempty"`
  133. WebsiteSummary string `json:"websiteSummary,omitempty"`
  134. StyleProfile DraftStyleProfile `json:"styleProfile,omitempty"`
  135. Prompt DraftPromptConfig `json:"prompt,omitempty"`
  136. }
  137. type DraftContext struct {
  138. IntakeSource string `json:"intakeSource,omitempty"`
  139. LLM DraftLLMContext `json:"llm,omitempty"`
  140. }
  141. type AppSettings struct {
  142. QCBaseURL string `json:"qcBaseUrl"`
  143. QCBearerTokenEncrypted string `json:"qcBearerTokenEncrypted"`
  144. LanguageOutputMode string `json:"languageOutputMode"`
  145. JobPollIntervalSeconds int `json:"jobPollIntervalSeconds"`
  146. JobPollTimeoutSeconds int `json:"jobPollTimeoutSeconds"`
  147. LLMActiveProvider string `json:"llmActiveProvider,omitempty"`
  148. LLMActiveModel string `json:"llmActiveModel,omitempty"`
  149. LLMBaseURL string `json:"llmBaseUrl,omitempty"`
  150. LLMTemperature float64 `json:"llmTemperature,omitempty"`
  151. LLMMaxTokens int `json:"llmMaxTokens,omitempty"`
  152. OpenAIAPIKeyEncrypted string `json:"openAiApiKeyEncrypted,omitempty"`
  153. AnthropicAPIKeyEncrypted string `json:"anthropicApiKeyEncrypted,omitempty"`
  154. GoogleAPIKeyEncrypted string `json:"googleApiKeyEncrypted,omitempty"`
  155. XAIAPIKeyEncrypted string `json:"xaiApiKeyEncrypted,omitempty"`
  156. OllamaAPIKeyEncrypted string `json:"ollamaApiKeyEncrypted,omitempty"`
  157. GooglePlacesAPIKeyEncrypted string `json:"googlePlacesApiKeyEncrypted,omitempty"`
  158. MasterPrompt string `json:"masterPrompt,omitempty"`
  159. PromptBlocks []PromptBlockConfig `json:"promptBlocks,omitempty"`
  160. }