Spaces:
Running
Running
Update service_config.jsonc
Browse files- service_config.jsonc +149 -149
service_config.jsonc
CHANGED
@@ -1,149 +1,149 @@
|
|
1 |
-
{
|
2 |
-
// =====================================================
|
3 |
-
// FLARE GLOBAL CONFIGURATION
|
4 |
-
// =====================================================
|
5 |
-
"config": {
|
6 |
-
"work_mode": "hfcloud", // "hfcloud" | "cloud" | "on-premise"
|
7 |
-
"cloud_token": "
|
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 |
-
"id": 1,
|
26 |
-
"name": "coronos_assistant", // Virtual agent adı
|
27 |
-
"caption": "Coronos Sanal Asistan",
|
28 |
-
"enabled": true, // Kullanımda olma durumu
|
29 |
-
"last_version_number": 1, // Projelerin version_number için versiyon counter. Artarak ilerler.
|
30 |
-
|
31 |
-
// -------------------------------------------------
|
32 |
-
// VERSIONS: Proje revizyonları ayrı bir version_number ile takip edilir.
|
33 |
-
// Yayınlanmış versiyonlar üzerinde düzenleme yapılamaz.
|
34 |
-
// Yeni versiyon oluşturumak için published versiyonlardan biri seçilir ve kopyası oluştulur, bu kopya üzerinde düzenleme yapılabilir.
|
35 |
-
// -------------------------------------------------
|
36 |
-
"versions": [
|
37 |
-
{
|
38 |
-
"id": 1, // Proje versiyonu
|
39 |
-
"caption": "v1",
|
40 |
-
"published": true, // Versiyonun yayınlanma durumu.
|
41 |
-
|
42 |
-
// === Virtual agent'ın yapabileceği işleri tarifler =========
|
43 |
-
"general_prompt": "You are an airline assistant. You can book tickets, give information about booked tickets ...",
|
44 |
-
|
45 |
-
// === LLM configuration =======================
|
46 |
-
"llm": {
|
47 |
-
"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
|
48 |
-
"generation_config": { // Llm'in kullanımı için gerekli konfigürasyon parametreleri
|
49 |
-
"max_new_tokens": 128,
|
50 |
-
"temperature": 0.3,
|
51 |
-
"top_p": 0.7,
|
52 |
-
"repetition_penalty": 1.1
|
53 |
-
},
|
54 |
-
"use_fine_tune": false, // LoRA fine-tune model kullanılma durumu
|
55 |
-
"fine_tune_zip": "" // use_fine_tune: true ise, kullanılacak LoRA adapter zip'in indirleceği url, ya da network file path.
|
56 |
-
},
|
57 |
-
|
58 |
-
// === INTENTS =================================
|
59 |
-
"intents": [
|
60 |
-
{
|
61 |
-
"name": "currency_rate_intent", // alt çizgi, tire yok
|
62 |
-
"caption": "Kur sorgulama",
|
63 |
-
"locale": "tr-TR",
|
64 |
-
"dependencies": [], // intent bağımlılıkları.
|
65 |
-
|
66 |
-
// Intent detection
|
67 |
-
"examples": [
|
68 |
-
"What is the dollar rate?",
|
69 |
-
"How much is the euro?"
|
70 |
-
],
|
71 |
-
"detection_prompt": "Identify if user is asking for currency rate information.", // Intent detection için kullanılacak system prompt.
|
72 |
-
|
73 |
-
// Parameters: Intent tespit edildiğinde, kullanıcının ifadesinden extract edilecek parametreler
|
74 |
-
"parameters": [
|
75 |
-
{
|
76 |
-
"name": "currency",
|
77 |
-
"caption": "Döviz cinsi", // Eksik parametreyi tamamlarken kullanıcıya söylenebilecek parametre adı
|
78 |
-
"type": "str", // "str" | "int" | "float"
|
79 |
-
"required": true,
|
80 |
-
"extraction_prompt": "Extract the currency code (USD, EUR, TRY) from the user message.", // Parametre extraction için kullanılacak system prompt
|
81 |
-
"validation_regex": "^(USD|EUR|TRY)$", // kullanıcıdan alınan parametre değerini validate etmek için kullanılacak regex. Opsiyonel.
|
82 |
-
"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
|
83 |
-
"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
|
84 |
-
}
|
85 |
-
],
|
86 |
-
|
87 |
-
// API to call
|
88 |
-
"action": "currency_api", // Bu intent tespit edilip, parametreleri tamamlandığında çağırılacak api'nin adı.
|
89 |
-
|
90 |
-
// Fallbacks
|
91 |
-
"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
|
92 |
-
"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
|
93 |
-
}
|
94 |
-
|
95 |
-
// ... başka intent'ler
|
96 |
-
]
|
97 |
-
}
|
98 |
-
|
99 |
-
// ... yeni versiyonlar
|
100 |
-
]
|
101 |
-
}
|
102 |
-
|
103 |
-
// ... başka projeler
|
104 |
-
],
|
105 |
-
|
106 |
-
// =====================================================
|
107 |
-
// API DEFINITIONS (dict by name): Intent’lerde action olarak kullanılacak api tanımları
|
108 |
-
// =====================================================
|
109 |
-
"apis":
|
110 |
-
[{
|
111 |
-
"name": "currency_api",
|
112 |
-
"url": "https://mock.api/currency",
|
113 |
-
"method": "POST",
|
114 |
-
|
115 |
-
// Headers as dict; placeholders destekler
|
116 |
-
"headers": {
|
117 |
-
"Content-Type": "application/json",
|
118 |
-
"Authorization": "Bearer {{auth_tokens.currency_api.token}}"
|
119 |
-
},
|
120 |
-
|
121 |
-
// Body template
|
122 |
-
"body_template": {
|
123 |
-
"currency": "{{variables.currency}}"
|
124 |
-
},
|
125 |
-
|
126 |
-
// Timeout & retry
|
127 |
-
"timeout_seconds": 5,
|
128 |
-
"retry": {
|
129 |
-
"retry_count": 3,
|
130 |
-
"backoff_seconds": 2,
|
131 |
-
"strategy": "static" // "static" | "exponential"
|
132 |
-
},
|
133 |
-
|
134 |
-
// Auth (optional)
|
135 |
-
"auth": {
|
136 |
-
"enabled": false,
|
137 |
-
"token_endpoint": "https://mock.api/auth",
|
138 |
-
"token_request_body": {},
|
139 |
-
"response_token_path": "token", // json-path style. Ex: xx.yy.z
|
140 |
-
"token_refresh_endpoint": null, // opsiyonel
|
141 |
-
"token_refresh_body": {} // token_refresh_endpoint varsa zorunlu, yoksa opsiyonel.
|
142 |
-
},
|
143 |
-
|
144 |
-
"proxy": "", // Proxy (optional)
|
145 |
-
|
146 |
-
// API response → human-friendly answer
|
147 |
-
"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}}"
|
148 |
-
}]
|
149 |
-
}
|
|
|
1 |
+
{
|
2 |
+
// =====================================================
|
3 |
+
// FLARE GLOBAL CONFIGURATION
|
4 |
+
// =====================================================
|
5 |
+
"config": {
|
6 |
+
"work_mode": "hfcloud", // "hfcloud" | "cloud" | "on-premise"
|
7 |
+
"cloud_token": "gAAAAABoQInC9AEAMjDXkUr2aePqITb26fDVbha4TnBAHQTtQyoGV3Exjtq5gbJJt-jKcQ2N8rzL6vBK_ZOu-CbgZvBInCt5mR8NqeDdDEN5FeCS5hM8DQWzSUJrreuMl4NKRJRoE3ce", // 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 |
+
"id": 1,
|
26 |
+
"name": "coronos_assistant", // Virtual agent adı
|
27 |
+
"caption": "Coronos Sanal Asistan",
|
28 |
+
"enabled": true, // Kullanımda olma durumu
|
29 |
+
"last_version_number": 1, // Projelerin version_number için versiyon counter. Artarak ilerler.
|
30 |
+
|
31 |
+
// -------------------------------------------------
|
32 |
+
// VERSIONS: Proje revizyonları ayrı bir version_number ile takip edilir.
|
33 |
+
// Yayınlanmış versiyonlar üzerinde düzenleme yapılamaz.
|
34 |
+
// Yeni versiyon oluşturumak için published versiyonlardan biri seçilir ve kopyası oluştulur, bu kopya üzerinde düzenleme yapılabilir.
|
35 |
+
// -------------------------------------------------
|
36 |
+
"versions": [
|
37 |
+
{
|
38 |
+
"id": 1, // Proje versiyonu
|
39 |
+
"caption": "v1",
|
40 |
+
"published": true, // Versiyonun yayınlanma durumu.
|
41 |
+
|
42 |
+
// === Virtual agent'ın yapabileceği işleri tarifler =========
|
43 |
+
"general_prompt": "You are an airline assistant. You can book tickets, give information about booked tickets ...",
|
44 |
+
|
45 |
+
// === LLM configuration =======================
|
46 |
+
"llm": {
|
47 |
+
"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
|
48 |
+
"generation_config": { // Llm'in kullanımı için gerekli konfigürasyon parametreleri
|
49 |
+
"max_new_tokens": 128,
|
50 |
+
"temperature": 0.3,
|
51 |
+
"top_p": 0.7,
|
52 |
+
"repetition_penalty": 1.1
|
53 |
+
},
|
54 |
+
"use_fine_tune": false, // LoRA fine-tune model kullanılma durumu
|
55 |
+
"fine_tune_zip": "" // use_fine_tune: true ise, kullanılacak LoRA adapter zip'in indirleceği url, ya da network file path.
|
56 |
+
},
|
57 |
+
|
58 |
+
// === INTENTS =================================
|
59 |
+
"intents": [
|
60 |
+
{
|
61 |
+
"name": "currency_rate_intent", // alt çizgi, tire yok
|
62 |
+
"caption": "Kur sorgulama",
|
63 |
+
"locale": "tr-TR",
|
64 |
+
"dependencies": [], // intent bağımlılıkları.
|
65 |
+
|
66 |
+
// Intent detection
|
67 |
+
"examples": [
|
68 |
+
"What is the dollar rate?",
|
69 |
+
"How much is the euro?"
|
70 |
+
],
|
71 |
+
"detection_prompt": "Identify if user is asking for currency rate information.", // Intent detection için kullanılacak system prompt.
|
72 |
+
|
73 |
+
// Parameters: Intent tespit edildiğinde, kullanıcının ifadesinden extract edilecek parametreler
|
74 |
+
"parameters": [
|
75 |
+
{
|
76 |
+
"name": "currency",
|
77 |
+
"caption": "Döviz cinsi", // Eksik parametreyi tamamlarken kullanıcıya söylenebilecek parametre adı
|
78 |
+
"type": "str", // "str" | "int" | "float"
|
79 |
+
"required": true,
|
80 |
+
"extraction_prompt": "Extract the currency code (USD, EUR, TRY) from the user message.", // Parametre extraction için kullanılacak system prompt
|
81 |
+
"validation_regex": "^(USD|EUR|TRY)$", // kullanıcıdan alınan parametre değerini validate etmek için kullanılacak regex. Opsiyonel.
|
82 |
+
"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
|
83 |
+
"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
|
84 |
+
}
|
85 |
+
],
|
86 |
+
|
87 |
+
// API to call
|
88 |
+
"action": "currency_api", // Bu intent tespit edilip, parametreleri tamamlandığında çağırılacak api'nin adı.
|
89 |
+
|
90 |
+
// Fallbacks
|
91 |
+
"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
|
92 |
+
"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
|
93 |
+
}
|
94 |
+
|
95 |
+
// ... başka intent'ler
|
96 |
+
]
|
97 |
+
}
|
98 |
+
|
99 |
+
// ... yeni versiyonlar
|
100 |
+
]
|
101 |
+
}
|
102 |
+
|
103 |
+
// ... başka projeler
|
104 |
+
],
|
105 |
+
|
106 |
+
// =====================================================
|
107 |
+
// API DEFINITIONS (dict by name): Intent’lerde action olarak kullanılacak api tanımları
|
108 |
+
// =====================================================
|
109 |
+
"apis":
|
110 |
+
[{
|
111 |
+
"name": "currency_api",
|
112 |
+
"url": "https://mock.api/currency",
|
113 |
+
"method": "POST",
|
114 |
+
|
115 |
+
// Headers as dict; placeholders destekler
|
116 |
+
"headers": {
|
117 |
+
"Content-Type": "application/json",
|
118 |
+
"Authorization": "Bearer {{auth_tokens.currency_api.token}}"
|
119 |
+
},
|
120 |
+
|
121 |
+
// Body template
|
122 |
+
"body_template": {
|
123 |
+
"currency": "{{variables.currency}}"
|
124 |
+
},
|
125 |
+
|
126 |
+
// Timeout & retry
|
127 |
+
"timeout_seconds": 5,
|
128 |
+
"retry": {
|
129 |
+
"retry_count": 3,
|
130 |
+
"backoff_seconds": 2,
|
131 |
+
"strategy": "static" // "static" | "exponential"
|
132 |
+
},
|
133 |
+
|
134 |
+
// Auth (optional)
|
135 |
+
"auth": {
|
136 |
+
"enabled": false,
|
137 |
+
"token_endpoint": "https://mock.api/auth",
|
138 |
+
"token_request_body": {},
|
139 |
+
"response_token_path": "token", // json-path style. Ex: xx.yy.z
|
140 |
+
"token_refresh_endpoint": null, // opsiyonel
|
141 |
+
"token_refresh_body": {} // token_refresh_endpoint varsa zorunlu, yoksa opsiyonel.
|
142 |
+
},
|
143 |
+
|
144 |
+
"proxy": "", // Proxy (optional)
|
145 |
+
|
146 |
+
// API response → human-friendly answer
|
147 |
+
"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}}"
|
148 |
+
}]
|
149 |
+
}
|