Underground-Digital/Workflow-Engine
0
1import type { LangFuseConfig, LangSmithConfig, TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'2import type { App, AppSSO, AppTemplate, SiteConfig } from '@/types/app'3 4/* export type App = {5 id: string6 name: string7 description: string8 mode: AppMode9 enable_site: boolean10 enable_api: boolean11 api_rpm: number12 api_rph: number13 is_demo: boolean14 model_config: AppModelConfig15 providers: Array<{ provider: string; token_is_set: boolean }>16 site: SiteConfig17 created_at: string18}19 20export type AppModelConfig = {21 provider: string22 model_id: string23 configs: {24 prompt_template: string25 prompt_variables: Array<PromptVariable>26 completion_params: CompletionParam27 }28}29 30export type PromptVariable = {31 key: string32 name: string33 description: string34 type: string | number35 default: string36 options: string[]37}38 39export type CompletionParam = {40 max_tokens: number41 temperature: number42 top_p: number43 echo: boolean44 stop: string[]45 presence_penalty: number46 frequency_penalty: number47}48 49export type SiteConfig = {50 access_token: string51 title: string52 author: string53 support_email: string54 default_language: string55 customize_domain: string56 theme: string57 customize_token_strategy: 'must' | 'allow' | 'not_allow'58 prompt_public: boolean59} */60 61export type AppListResponse = {62 data: App[]63 has_more: boolean64 limit: number65 page: number66 total: number67}68 69export type AppDetailResponse = App70export type AppSSOResponse = { enabled: AppSSO['enable_sso'] }71 72export type AppTemplatesResponse = {73 data: AppTemplate[]74}75 76export type CreateAppResponse = App77 78export type UpdateAppSiteCodeResponse = { app_id: string } & SiteConfig79 80export type AppDailyMessagesResponse = {81 data: Array<{ date: string; message_count: number }>82}83 84export type AppDailyConversationsResponse = {85 data: Array<{ date: string; conversation_count: number }>86}87 88export type WorkflowDailyConversationsResponse = {89 data: Array<{ date: string; runs: number }>90}91 92export type AppStatisticsResponse = {93 data: Array<{ date: string }>94}95 96export type AppDailyEndUsersResponse = {97 data: Array<{ date: string; terminal_count: number }>98}99 100export type AppTokenCostsResponse = {101 data: Array<{ date: string; token_count: number; total_price: number; currency: number }>102}103 104export type UpdateAppModelConfigResponse = { result: string }105 106export type ApiKeyItemResponse = {107 id: string108 token: string109 last_used_at: string110 created_at: string111}112 113export type ApiKeysListResponse = {114 data: ApiKeyItemResponse[]115}116 117export type CreateApiKeyResponse = {118 id: string119 token: string120 created_at: string121}122 123export type ValidateOpenAIKeyResponse = {124 result: string125 error?: string126}127 128export type UpdateOpenAIKeyResponse = ValidateOpenAIKeyResponse129 130export type GenerationIntroductionResponse = {131 introduction: string132}133 134export type AppVoicesListResponse = [{135 name: string136 value: string137}]138 139export type TracingStatus = {140 enabled: boolean141 tracing_provider: TracingProvider | null142}143 144export type TracingConfig = {145 tracing_provider: TracingProvider146 tracing_config: LangSmithConfig | LangFuseConfig147}148 