Spaces:
Building
Building
Upload service_config.jsonc
Browse files- service_config.jsonc +153 -150
service_config.jsonc
CHANGED
@@ -1,150 +1,153 @@
|
|
1 |
-
{
|
2 |
-
// =====================================================
|
3 |
-
// FLARE GLOBAL CONFIGURATION
|
4 |
-
// =====================================================
|
5 |
-
"config": {
|
6 |
-
"work_mode": "hfcloud", // "hfcloud" | "cloud" | "on-premise"
|
7 |
-
"cloud_token": "<your cloud token>", // hfcloud
|
8 |
-
"spark_endpoint": "https://ucsturkey-spark.hf.space",
|
9 |
-
|
10 |
-
// === Login Users (bcrypt hash + salt) ==============
|
11 |
-
"users": [
|
12 |
-
{
|
13 |
-
"username": "admin",
|
14 |
-
"password_hash": "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918",
|
15 |
-
"salt": "random_salt_string"
|
16 |
-
}
|
17 |
-
]
|
18 |
-
},
|
19 |
-
|
20 |
-
// =====================================================
|
21 |
-
// PROJECTS
|
22 |
-
// =====================================================
|
23 |
-
"projects": [
|
24 |
-
{
|
25 |
-
"name": "coronos_assistant",
|
26 |
-
"enabled": true,
|
27 |
-
"last_version_number": 1,
|
28 |
-
|
29 |
-
// -------------------------------------------------
|
30 |
-
// VERSIONS
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
"
|
47 |
-
"
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
"
|
59 |
-
"
|
60 |
-
|
61 |
-
//
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
//
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
"
|
74 |
-
|
75 |
-
"
|
76 |
-
"
|
77 |
-
"
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
//
|
85 |
-
"
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
"
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
}
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
// =====================================================
|
3 |
+
// FLARE GLOBAL CONFIGURATION
|
4 |
+
// =====================================================
|
5 |
+
"config": {
|
6 |
+
"work_mode": "hfcloud", // "hfcloud" | "cloud" | "on-premise"
|
7 |
+
"cloud_token": "<your cloud token>", // eğer workmode hfcloud ya da cloud ise zorunlu, on-premise'de kullanılmayacak.
|
8 |
+
"spark_endpoint": "https://ucsturkey-spark.hf.space", // Spark servisine erişim için kullanılacak url
|
9 |
+
|
10 |
+
// === Login Users (bcrypt hash + salt): Flare UI kullanılabilecek user'lar ==============
|
11 |
+
"users": [
|
12 |
+
{
|
13 |
+
"username": "admin",
|
14 |
+
"password_hash": "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918",
|
15 |
+
"salt": "random_salt_string"
|
16 |
+
}
|
17 |
+
]
|
18 |
+
},
|
19 |
+
|
20 |
+
// =====================================================
|
21 |
+
// PROJECTS: Her bir proje bir virtual agent'ı tanımlar
|
22 |
+
// =====================================================
|
23 |
+
"projects": [
|
24 |
+
{
|
25 |
+
"name": "coronos_assistant", // Virtual agent adı
|
26 |
+
"enabled": true, // Kullanımda olma durumu
|
27 |
+
"last_version_number": 1, // Projelerin version_number için versiyon counter. Artarak ilerler.
|
28 |
+
|
29 |
+
// -------------------------------------------------
|
30 |
+
// VERSIONS: Proje revizyonları ayrı bir version_number ile takip edilir.
|
31 |
+
// Yayınlanmış versiyonlar üzerinde düzenleme yapılamaz.
|
32 |
+
// Yeni versiyon oluşturumak için published versiyonlardan biri seçilir ve kopyası oluştulur, bu kopya üzerinde düzenleme yapılabilir.
|
33 |
+
// -------------------------------------------------
|
34 |
+
"versions": [
|
35 |
+
{
|
36 |
+
"version_number": 1, // Proje versiyonu
|
37 |
+
"published": true, // Versiyonun yayınlanma durumu.
|
38 |
+
|
39 |
+
// === Virtual agent'ın yapabileceği işleri tarifler =========
|
40 |
+
"general_prompt": "You are an airline assistant. You can book tickets, give information about booked tickets ...",
|
41 |
+
|
42 |
+
// === LLM configuration =======================
|
43 |
+
"llm": {
|
44 |
+
"repo_id": "ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1", // eğer workmode hfcloud ve cloud ise, kullanılacak llm'in repo id'si. Eğer on-premise ise, llm'in indirileceği url ya da llm'in indirilmeden kullanılacağı network folder path
|
45 |
+
"generation_config": { // Llm'in kullanımı için gerekli konfigürasyon parametreleri
|
46 |
+
"max_new_tokens": 128,
|
47 |
+
"temperature": 0.3,
|
48 |
+
"top_p": 0.7,
|
49 |
+
"repetition_penalty": 1.1
|
50 |
+
},
|
51 |
+
"use_fine_tune": false, // LoRA fine-tune model kullanılma durumu
|
52 |
+
"fine_tune_zip": "" // use_fine_tune: true ise, kullanılacak LoRA adapter zip'in indirleceği url, ya da network file path.
|
53 |
+
},
|
54 |
+
|
55 |
+
// === INTENTS =================================
|
56 |
+
"intents": [
|
57 |
+
{
|
58 |
+
"name": "currency_rate_intent", // alt çizgi, tire yok
|
59 |
+
"caption": "Kur sorgulama",
|
60 |
+
"locale": "tr-TR",
|
61 |
+
"dependencies": [], // intent bağımlılıkları.
|
62 |
+
|
63 |
+
// Intent detection
|
64 |
+
"examples": [
|
65 |
+
"What is the dollar rate?",
|
66 |
+
"How much is the euro?"
|
67 |
+
],
|
68 |
+
"detection_prompt": "Identify if user is asking for currency rate information.", // Intent detection için kullanılacak system prompt.
|
69 |
+
|
70 |
+
// Parameters: Intent tespit edildiğinde, kullanıcının ifadesinden extract edilecek parametreler
|
71 |
+
"parameters": [
|
72 |
+
{
|
73 |
+
"name": "currency",
|
74 |
+
"caption": "Döviz cinsi", // Eksik parametreyi tamamlarken kullanıcıya söylenebilecek parametre adı
|
75 |
+
"type": "string",
|
76 |
+
"required": true,
|
77 |
+
"extraction_prompt": "Extract the currency code (USD, EUR, TRY) from the user message.", // Parametre extraction için kullanılacak system prompt
|
78 |
+
"validation_regex": "^(USD|EUR|TRY)$", // kullanıcıdan alınan parametre değerini validate etmek için kullanılacak regex. Opsiyonel.
|
79 |
+
"invalid_prompt": "Geçersiz para birimi girdiniz. USD, EUR veya TRY şeklinde giriniz.", // Parametre değeri invalid ise kullanıcıya söylenecek mesajı oluşturacak system prompt
|
80 |
+
"type_error_prompt": "Para birimi metin olmalıdır (ör: USD)." // Eğer parametre tipi hatalıysa kullanıcıya söylenecek mesajı oluşturacak system prompt
|
81 |
+
}
|
82 |
+
],
|
83 |
+
|
84 |
+
// API to call
|
85 |
+
"action": "currency_api", // Bu intent tespit edilip, parametreleri tamamlandığında çağırılacak api'nin adı.
|
86 |
+
|
87 |
+
// Fallbacks
|
88 |
+
"fallback_timeout_prompt": "Kur servisinde gecikme yaşanıyor. Lütfen biraz sonra tekrar deneyin.", // Api timeout durumunda kullanıcıya söylenecek mesajı oluşturacak system prompt
|
89 |
+
"fallback_error_prompt": "Kur bilgileri alınırken bir hata oluştu, daha sonra tekrar deneyebilir misiniz?" // Api hatası durumunda kullanıcıya söylenecek mesajı oluşturacak system prompt
|
90 |
+
}
|
91 |
+
|
92 |
+
// ... başka intent'ler
|
93 |
+
]
|
94 |
+
}
|
95 |
+
|
96 |
+
// ... yeni versiyonlar
|
97 |
+
]
|
98 |
+
}
|
99 |
+
|
100 |
+
// ... başka projeler
|
101 |
+
],
|
102 |
+
|
103 |
+
// =====================================================
|
104 |
+
// API DEFINITIONS (dict by name)
|
105 |
+
// =====================================================
|
106 |
+
"apis": {
|
107 |
+
"currency_api": {
|
108 |
+
"url": "https://mock.api/currency",
|
109 |
+
"method": "POST",
|
110 |
+
|
111 |
+
// Headers as dict; placeholders destekler
|
112 |
+
"headers": {
|
113 |
+
"Content-Type": "application/json",
|
114 |
+
"Authorization": "Bearer {{auth_tokens.currency_api.token}}"
|
115 |
+
},
|
116 |
+
|
117 |
+
// Body template
|
118 |
+
"body_template": {
|
119 |
+
"currency": "{{variables.currency}}"
|
120 |
+
},
|
121 |
+
|
122 |
+
// Timeout & retry
|
123 |
+
"timeout_seconds": 5,
|
124 |
+
"retry": {
|
125 |
+
"max_attempts": 3,
|
126 |
+
"backoff_seconds": 2,
|
127 |
+
"strategy": "static" // "static" | "exponential"
|
128 |
+
},
|
129 |
+
|
130 |
+
// Auth (optional)
|
131 |
+
"auth": {
|
132 |
+
"enabled": true,
|
133 |
+
"token_endpoint": "https://mock.api/auth",
|
134 |
+
"body_template": {
|
135 |
+
"client_id": "...",
|
136 |
+
"client_secret": "..."
|
137 |
+
},
|
138 |
+
"response_token_path": "token", // json-path style. Ex: xx.yy.z
|
139 |
+
"token_refresh_endpoint": "", // opsiyonel
|
140 |
+
"token_refresh_body": {} // token_refresh_endpoint varsa zorunlu, yoksa opsiyonel.
|
141 |
+
},
|
142 |
+
|
143 |
+
// Proxy (optional)
|
144 |
+
"proxy": {
|
145 |
+
"enabled": false,
|
146 |
+
"url": "http://proxy.local:8080" // enabled: true ise zorunlu, değilse opsiyonel
|
147 |
+
},
|
148 |
+
|
149 |
+
// API response → human-friendly answer
|
150 |
+
"response_prompt": "Aşağıdaki JSON döviz kuru bilgilerini içeriyor. Kullanıcıya anlaşılır bir Türkçe özet hazırla:\n\n{{api_response}}"
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|