Spaces:
Paused
Paused
Update flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
CHANGED
|
@@ -121,50 +121,37 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
| 121 |
|
| 122 |
loadVersion(version: Version) {
|
| 123 |
this.selectedVersion = version;
|
|
|
|
|
|
|
| 124 |
this.versionForm.patchValue({
|
|
|
|
| 125 |
caption: version.caption || '',
|
| 126 |
-
description: version.caption || '', // description yerine caption kullan
|
| 127 |
-
default_api: version.default_api || '',
|
| 128 |
published: version.published || false,
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
max_new_tokens: 512,
|
| 132 |
-
temperature: 0.7,
|
| 133 |
-
top_p: 0.95,
|
| 134 |
-
top_k: 50,
|
| 135 |
-
repetition_penalty: 1.1
|
| 136 |
-
},
|
| 137 |
-
use_fine_tune: version.llm?.use_fine_tune || false,
|
| 138 |
-
fine_tune_zip: version.llm?.fine_tune_zip || ''
|
| 139 |
});
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
// Clear and rebuild intents
|
| 142 |
this.intents.clear();
|
| 143 |
(version.intents || []).forEach(intent => {
|
| 144 |
-
this.
|
| 145 |
-
const intentIndex = this.intents.length - 1;
|
| 146 |
-
const intentGroup = this.intents.at(intentIndex);
|
| 147 |
-
|
| 148 |
-
intentGroup.patchValue({
|
| 149 |
-
name: intent.name,
|
| 150 |
-
description: intent.description || '',
|
| 151 |
-
api_to_call: intent.api_to_call || '',
|
| 152 |
-
enabled: intent.enabled !== false
|
| 153 |
-
});
|
| 154 |
-
|
| 155 |
-
// Add intent parameters
|
| 156 |
-
const paramsArray = this.getIntentParameters(intentIndex);
|
| 157 |
-
paramsArray.clear();
|
| 158 |
-
(intent.parameters || []).forEach((param: any) => {
|
| 159 |
-
paramsArray.push(this.createParameterFormGroup(param));
|
| 160 |
-
});
|
| 161 |
-
|
| 162 |
-
// Add examples
|
| 163 |
-
const examplesArray = this.getIntentExamples(intentIndex);
|
| 164 |
-
examplesArray.clear();
|
| 165 |
-
(intent.examples || []).forEach((example: any) => {
|
| 166 |
-
examplesArray.push(this.fb.control(example));
|
| 167 |
-
});
|
| 168 |
});
|
| 169 |
}
|
| 170 |
|
|
|
|
| 121 |
|
| 122 |
loadVersion(version: Version) {
|
| 123 |
this.selectedVersion = version;
|
| 124 |
+
|
| 125 |
+
// Form değerlerini set et
|
| 126 |
this.versionForm.patchValue({
|
| 127 |
+
id: version.id,
|
| 128 |
caption: version.caption || '',
|
|
|
|
|
|
|
| 129 |
published: version.published || false,
|
| 130 |
+
general_prompt: '', // Bu alan version'da yok, backend'de kontrol edilmeli
|
| 131 |
+
last_update_date: version.last_update_date || ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
});
|
| 133 |
|
| 134 |
+
// LLM config'i ayrı set et
|
| 135 |
+
if (version.llm) {
|
| 136 |
+
this.versionForm.patchValue({
|
| 137 |
+
llm: {
|
| 138 |
+
repo_id: version.llm.repo_id || '',
|
| 139 |
+
generation_config: version.llm.generation_config || {
|
| 140 |
+
max_new_tokens: 512,
|
| 141 |
+
temperature: 0.7,
|
| 142 |
+
top_p: 0.95,
|
| 143 |
+
repetition_penalty: 1.1
|
| 144 |
+
},
|
| 145 |
+
use_fine_tune: version.llm.use_fine_tune || false,
|
| 146 |
+
fine_tune_zip: version.llm.fine_tune_zip || ''
|
| 147 |
+
}
|
| 148 |
+
});
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
// Clear and rebuild intents
|
| 152 |
this.intents.clear();
|
| 153 |
(version.intents || []).forEach(intent => {
|
| 154 |
+
this.intents.push(this.createIntentFormGroup(intent));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
});
|
| 156 |
}
|
| 157 |
|