Spaces:
Running
Running
File size: 1,085 Bytes
67cc066 b232328 67cc066 b232328 67cc066 b232328 67cc066 b232328 67cc066 b232328 67cc066 b232328 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
"""
Flare – Prompt Builder helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karmaşık şablonlar Spark tarafında derinleştirilecek ama
ilk versiyon için basit string concat yeterli.
"""
from __future__ import annotations
from typing import List
from config_provider import IntentConfig, ParameterConfig
def build_detection_prompt(general: str, intent: IntentConfig) -> str:
examples = "\n".join(f"- {e}" for e in intent.examples)
return f"{general}\nÖrnekler:\n{examples}\nBu mesaj yukarıdaki niyetlerden hangisine ait?"
def build_param_extract_prompt(general: str, intent: IntentConfig, missing: List[ParameterConfig]) -> str:
names = ", ".join(p.name for p in missing)
return f"{general}\nIntent: {intent.name}\nEksik parametreleri çıkar: {names}"
def build_missing_param_prompt(missing: List[str]) -> str:
list_ = ", ".join(missing)
return f"{list_} değer(ler)ine ihtiyacım var, paylaşır mısın?"
def build_api_humanize_prompt(general: str, response_prompt: str, api_json: str) -> str:
return f"{general}\n{response_prompt}\nJSON:\n{api_json}"
|