hee_!J commited on
Commit ยท
0969faa
1
Parent(s): 26084d8
feat(rag): CRAG self-correction (retrieval grader + query refiner)
Browse files- agents/rag/crag.py +202 -0
- agents/tools/knowledge.py +29 -11
agents/rag/crag.py
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""CRAG (Corrective Retrieval-Augmented Generation)
|
| 2 |
+
|
| 3 |
+
๊ฒ์ ๊ฒฐ๊ณผ์ ๊ด๋ จ์ฑ์ LLM์ด ์์ฒด ํ๊ฐํ๊ณ , ์๊ณ์น ๋ฏธ๋ฌ ์ ์ฟผ๋ฆฌ๋ฅผ ์ฌ์์ฑํด ์ฌ๊ฒ์ํฉ๋๋ค.
|
| 4 |
+
Yan et al., 2024 "Corrective Retrieval Augmented Generation" ํจํด์ ๋ณธ ๋๋ฉ์ธ์ ์ ์.
|
| 5 |
+
|
| 6 |
+
ํ๋ฆ:
|
| 7 |
+
1. base retrieval (hybrid)
|
| 8 |
+
2. **grade**: ๊ฐ ๋ฌธ์๊ฐ ์ฟผ๋ฆฌ์ ๊ด๋ จ ์๋์ง LLM์ด 0~1 ์ ์ ๋ถ์ฌ
|
| 9 |
+
3. avg_score >= THRESHOLD ๋ฉด ๊ทธ๋๋ก ๋ฐํ
|
| 10 |
+
4. ๋ฏธ๋ง์ด๋ฉด **refine**: LLM์ด ๋์์ดยท๊ด๋ จ ๋๋ฉ์ธ ์ฉ์ด๋ฅผ ํ์ฉํด ์ฟผ๋ฆฌ ์ฌ์์ฑ
|
| 11 |
+
5. ์ฌ๊ฒ์ (max_retries ๊น์ง)
|
| 12 |
+
|
| 13 |
+
๋น์ฉ ์ต์ํ๋ฅผ ์ํด grader/refiner๋ gpt-4o-mini ์ฌ์ฉ.
|
| 14 |
+
ํ๊ฒฝ๋ณ์ CRAG_ENABLED=false๋ก ์ ์ฒด ๋นํ์ฑ ๊ฐ๋ฅ (์คํ ๋น๊ต์ฉ).
|
| 15 |
+
"""
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
from agents.llm import client
|
| 20 |
+
from agents.rag.store import load_document, search
|
| 21 |
+
|
| 22 |
+
GRADER_MODEL = "gpt-4o-mini"
|
| 23 |
+
RELEVANCE_THRESHOLD = 0.5 # avg ์ ์ ๋ฏธ๋ง์ด๋ฉด refinement ์๋
|
| 24 |
+
DEFAULT_MAX_RETRIES = 1
|
| 25 |
+
|
| 26 |
+
_GRADE_SCHEMA = {
|
| 27 |
+
"type": "object",
|
| 28 |
+
"properties": {
|
| 29 |
+
"grades": {
|
| 30 |
+
"type": "array",
|
| 31 |
+
"items": {
|
| 32 |
+
"type": "object",
|
| 33 |
+
"properties": {
|
| 34 |
+
"index": {"type": "integer"},
|
| 35 |
+
"score": {"type": "number"},
|
| 36 |
+
"reason": {"type": "string"},
|
| 37 |
+
},
|
| 38 |
+
"required": ["index", "score", "reason"],
|
| 39 |
+
"additionalProperties": False,
|
| 40 |
+
},
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"required": ["grades"],
|
| 44 |
+
"additionalProperties": False,
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def _llm_call(prompt: str, schema: dict | None = None):
|
| 49 |
+
kwargs = {
|
| 50 |
+
"model": GRADER_MODEL,
|
| 51 |
+
"messages": [{"role": "user", "content": prompt}],
|
| 52 |
+
"temperature": 0,
|
| 53 |
+
}
|
| 54 |
+
if schema:
|
| 55 |
+
kwargs["response_format"] = {
|
| 56 |
+
"type": "json_schema",
|
| 57 |
+
"json_schema": {"name": "out", "schema": schema, "strict": True},
|
| 58 |
+
}
|
| 59 |
+
return client().chat.completions.create(**kwargs)
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def grade_retrieval(query: str, docs: list[dict]) -> list[dict]:
|
| 63 |
+
"""๊ฐ ๋ฌธ์์ query ๊ด๋ จ์ฑ์ 0~1๋ก ์ฑ์
|
| 64 |
+
|
| 65 |
+
docs: [{"doc_id": str, "snippet": str}, ...]
|
| 66 |
+
๋ฐํ: [{"index": int, "score": float, "reason": str}, ...]
|
| 67 |
+
"""
|
| 68 |
+
if not docs:
|
| 69 |
+
return []
|
| 70 |
+
doc_block = "\n\n".join(
|
| 71 |
+
f"[doc_{i}] (id={d['doc_id']})\n{d['snippet'][:600]}" for i, d in enumerate(docs)
|
| 72 |
+
)
|
| 73 |
+
prompt = f"""๋น์ ์ ๋ฐ๋์ฒด ๊ณต์ ๋๋ฉ์ธ์ retrieval ํ๊ฐ์์
๋๋ค.
|
| 74 |
+
๋ค์ ์ฟผ๋ฆฌ์ ๋ํด ๊ฐ ๋ฌธ์๊ฐ ๋ต๋ณ ์์ฑ์ ์ผ๋ง๋ ์ง์ ๊ธฐ์ฌํ ์ ์๋์ง ํ๊ฐํ์ธ์.
|
| 75 |
+
|
| 76 |
+
[์ฟผ๋ฆฌ]
|
| 77 |
+
{query}
|
| 78 |
+
|
| 79 |
+
[๊ฒ์๋ ๋ฌธ์๋ค]
|
| 80 |
+
{doc_block}
|
| 81 |
+
|
| 82 |
+
๊ฐ ๋ฌธ์์ ๋ํด 0~1 ์ ์(์์ ๋์งธ ์๋ฆฌ)์ ํ ์ค reason์ JSON์ผ๋ก ์๋ต:
|
| 83 |
+
{{"grades": [
|
| 84 |
+
{{"index": 0, "score": 0.85, "reason": "์ฟผ๋ฆฌ์ ํต์ฌ ์ฆ์ยท์์ธ์ ์ง์ ๊ธฐ์ "}},
|
| 85 |
+
...
|
| 86 |
+
]}}
|
| 87 |
+
|
| 88 |
+
[์ฑ์ ๊ธฐ์ค]
|
| 89 |
+
- 0.0: ์ฟผ๋ฆฌ์ ๋ฌด๊ด, ๋๋ ์ฟผ๋ฆฌ๊ฐ ์๋ฏธ ๋ถ๋ช
/๋ฌด์์ ์
๋ ฅ
|
| 90 |
+
- 0.1~0.3: ๋๋ฉ์ธ์ ๊ฐ์ผ๋ ๋ค๋ฅธ ์ฃผ์ (์: ์ฟผ๋ฆฌ๊ฐ Photo์ธ๋ฐ ๋ฌธ์๋ CMP)
|
| 91 |
+
- 0.4~0.6: ์ธ์ ์ฃผ์ ๋๋ ์ผ๋ฐ๋ก (์ง์ ๋ต์ ์ ๋์ง๋ง ๋งฅ๋ฝ์ ๋จ)
|
| 92 |
+
- 0.7~0.9: ์ง์ ๊ด๋ จ (๊ตฌ์ฒด์ ์ฌ๋กยทSOPยท๊ทผ๊ฑฐ)
|
| 93 |
+
- 1.0: ์ฟผ๋ฆฌ ํต์ฌ ํค์๋๋ฅผ ๋ชจ๋ ํฌํจํ๊ณ ๋ต๋ณ ์์ฑ์ ์ง์ ๊ธฐ์ฌ
|
| 94 |
+
|
| 95 |
+
[์ค์]
|
| 96 |
+
- ์ฟผ๋ฆฌ๊ฐ ์๋ฏธ ๋ถ๋ช
ยท๋ฌด์์ ๋จ์ดยท๋ค๋ฅธ ๋๋ฉ์ธ์ด๋ฉด ๋ชจ๋ ๋ฌธ์์ 0.0 ๋ถ์ฌ
|
| 97 |
+
- ๋๋ฉ์ธ(๋ฐ๋์ฒด ๊ณต์ )์ด ๊ฐ๋ค๋ ์ด์ ๋ง์ผ๋ก ์ ์๋ฅผ ๋์ด์ง ๋ง์ธ์
|
| 98 |
+
- ๋ณด์์ ์ผ๋ก ์ฑ์ ํ์ธ์ (์์ฌ์ค๋ฌ์ฐ๋ฉด ๋ฎ์ ์ ์)"""
|
| 99 |
+
try:
|
| 100 |
+
resp = _llm_call(prompt, schema=_GRADE_SCHEMA)
|
| 101 |
+
parsed = json.loads(resp.choices[0].message.content)
|
| 102 |
+
return parsed.get("grades", [])
|
| 103 |
+
except (json.JSONDecodeError, KeyError):
|
| 104 |
+
return [{"index": i, "score": 0.5, "reason": "(grader parse failed)"} for i in range(len(docs))]
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def refine_query(original_query: str, weak_docs: list[dict]) -> str:
|
| 108 |
+
"""์ฝํ ๊ฒ์ ๊ฒฐ๊ณผ๋ฅผ ๋ณด๊ณ ์ฟผ๋ฆฌ๋ฅผ ์ฌ์์ฑ"""
|
| 109 |
+
weak_block = "\n".join(
|
| 110 |
+
f"- [{d['doc_id']}] {d['snippet'][:200]}" for d in weak_docs
|
| 111 |
+
)
|
| 112 |
+
prompt = f"""์ ์ฟผ๋ฆฌ๊ฐ ์ ์ ํ ๋ฌธ์๋ฅผ ์ฐพ์ง ๋ชปํ์ต๋๋ค. ๋ ์ ์๋ํ ์ฟผ๋ฆฌ๋ก ํ ์ค ์ฌ์์ฑํ์ธ์.
|
| 113 |
+
|
| 114 |
+
[์ ์ฟผ๋ฆฌ]
|
| 115 |
+
{original_query}
|
| 116 |
+
|
| 117 |
+
[๊ฒ์๋ (๊ด๋ จ์ฑ ๋ฎ์) ๋ฌธ์๋ค]
|
| 118 |
+
{weak_block}
|
| 119 |
+
|
| 120 |
+
[์ฌ์์ฑ ๊ท์น]
|
| 121 |
+
- ๋์์ดยท๊ด๋ จ ๋๋ฉ์ธ ์ฉ์ด ํ์ฉ (์: '๋ ์ฆ ์ค์ผ' โ 'ํค์ด์ฆ, ๊ดํ ํ๋ฉด ์ค์ผ, projection lens contamination')
|
| 122 |
+
- ๋๋ฌด ์ข๊ฑฐ๋ ๋๋ฌด ๋์ง ์๊ฒ ์ ์ง
|
| 123 |
+
- ํ๊ตญ์ด + ์์ด ๋๋ฉ์ธ ์ฉ์ด ํผ์ฉ ๊ฐ๋ฅ
|
| 124 |
+
- ์ฝ 10~25 ๋จ์ด
|
| 125 |
+
|
| 126 |
+
์ฌ์์ฑ๋ ์ฟผ๋ฆฌ๋ง ํ ์ค๋ก ๋ตํ์ธ์ (๋ค๋ฅธ ์ค๋ช
์์ด):"""
|
| 127 |
+
resp = _llm_call(prompt)
|
| 128 |
+
content = resp.choices[0].message.content or ""
|
| 129 |
+
return content.strip().splitlines()[0] if content.strip() else original_query
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
def crag_search(
|
| 133 |
+
query: str,
|
| 134 |
+
top_k: int = 3,
|
| 135 |
+
max_retries: int = DEFAULT_MAX_RETRIES,
|
| 136 |
+
trace_list: list | None = None,
|
| 137 |
+
) -> dict:
|
| 138 |
+
"""CRAG: search โ grade โ (๋ฎ์ผ๋ฉด) refine โ re-search
|
| 139 |
+
|
| 140 |
+
๋ฐํ: {"hits": [{"doc_id", "snippet", "relevance_score"}, ...],
|
| 141 |
+
"crag_meta": {"retries": int, "final_query": str, "final_avg_score": float}}
|
| 142 |
+
"""
|
| 143 |
+
current_query = query
|
| 144 |
+
retries = 0
|
| 145 |
+
last_docs: list[dict] = []
|
| 146 |
+
last_grades: list[dict] = []
|
| 147 |
+
avg_score = 0.0
|
| 148 |
+
|
| 149 |
+
while True:
|
| 150 |
+
doc_ids = search(current_query, top_k=top_k)
|
| 151 |
+
docs = []
|
| 152 |
+
for d in doc_ids:
|
| 153 |
+
text = load_document(d)
|
| 154 |
+
if not text:
|
| 155 |
+
continue
|
| 156 |
+
docs.append({"doc_id": d, "snippet": text[:600] + ("..." if len(text) > 600 else "")})
|
| 157 |
+
|
| 158 |
+
if not docs:
|
| 159 |
+
break
|
| 160 |
+
|
| 161 |
+
grades = grade_retrieval(current_query, docs)
|
| 162 |
+
avg_score = sum(g.get("score", 0.0) for g in grades) / max(len(grades), 1)
|
| 163 |
+
last_docs = docs
|
| 164 |
+
last_grades = grades
|
| 165 |
+
|
| 166 |
+
if trace_list is not None:
|
| 167 |
+
trace_list.append({
|
| 168 |
+
"query": current_query,
|
| 169 |
+
"retry": retries,
|
| 170 |
+
"avg_score": round(avg_score, 3),
|
| 171 |
+
"doc_ids": [d["doc_id"] for d in docs],
|
| 172 |
+
"grades": [{"id": docs[g["index"]]["doc_id"], "score": g["score"]}
|
| 173 |
+
for g in grades if g.get("index", -1) < len(docs)],
|
| 174 |
+
})
|
| 175 |
+
|
| 176 |
+
if avg_score >= RELEVANCE_THRESHOLD or retries >= max_retries:
|
| 177 |
+
break
|
| 178 |
+
|
| 179 |
+
# ๊ด๋ จ์ฑ ๋ฎ์ โ query refinement
|
| 180 |
+
current_query = refine_query(current_query, docs)
|
| 181 |
+
retries += 1
|
| 182 |
+
|
| 183 |
+
# docs์ grades ์ ๋ ฌ (index ๊ธฐ์ค)
|
| 184 |
+
score_by_idx = {g["index"]: g.get("score", 0.0) for g in last_grades}
|
| 185 |
+
hits = [
|
| 186 |
+
{"doc_id": d["doc_id"], "snippet": d["snippet"], "relevance_score": round(score_by_idx.get(i, 0.0), 2)}
|
| 187 |
+
for i, d in enumerate(last_docs)
|
| 188 |
+
]
|
| 189 |
+
return {
|
| 190 |
+
"hits": hits,
|
| 191 |
+
"crag_meta": {
|
| 192 |
+
"retries": retries,
|
| 193 |
+
"final_query": current_query,
|
| 194 |
+
"final_avg_score": round(avg_score, 3),
|
| 195 |
+
"refined": retries > 0,
|
| 196 |
+
},
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
def crag_enabled() -> bool:
|
| 201 |
+
"""ํ๊ฒฝ๋ณ์๋ก CRAG on/off ํ ๊ธ (๊ธฐ๋ณธ on)"""
|
| 202 |
+
return os.getenv("CRAG_ENABLED", "true").lower() not in ("false", "0", "no")
|
agents/tools/knowledge.py
CHANGED
|
@@ -1,22 +1,39 @@
|
|
| 1 |
-
"""search_knowledge tool - RAG ๊ฒ์
|
| 2 |
|
| 3 |
-
๊ธฐ
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
"""
|
|
|
|
| 6 |
from agents.rag.store import load_document, search
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def search_knowledge(query: str, top_k: int = 3) -> dict:
|
| 10 |
-
"""์ฌ๋ด ์ง์ ๋ฌธ์
|
| 11 |
|
| 12 |
-
|
| 13 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
doc_ids = search(query, top_k=top_k)
|
| 15 |
hits = []
|
| 16 |
-
for
|
| 17 |
-
text = load_document(
|
| 18 |
-
|
| 19 |
-
hits.append({"doc_id": doc_id, "snippet": snippet})
|
| 20 |
return {"hits": hits}
|
| 21 |
|
| 22 |
|
|
@@ -26,8 +43,9 @@ SCHEMA = {
|
|
| 26 |
"name": "search_knowledge",
|
| 27 |
"description": (
|
| 28 |
"์ฌ๋ด ์ง์ ๋ฌธ์(๊ณผ๊ฑฐ ์ฌ๋ก INC, ์คํจ ๋ชจ๋ FMEA, ํ์ค ์ ์ฐจ SOP, ๊ณต์ ํ๋ฆ FLOW)๋ฅผ "
|
| 29 |
-
"hybrid ๊ฒ์
|
| 30 |
-
"
|
|
|
|
| 31 |
),
|
| 32 |
"parameters": {
|
| 33 |
"type": "object",
|
|
|
|
| 1 |
+
"""search_knowledge tool - RAG ๊ฒ์ (CRAG self-correction ํฌํจ)
|
| 2 |
|
| 3 |
+
๊ธฐ๋ณธ์ CRAG ํ์ฑํ (๊ฒ์ โ ๊ด๋ จ์ฑ ํ๊ฐ โ ๋ฏธ๋ฌ ์ ์ฟผ๋ฆฌ ์ฌ์์ฑ + ์ฌ๊ฒ์).
|
| 4 |
+
ํ๊ฒฝ๋ณ์ CRAG_ENABLED=false ๋ก ๋นํ์ฑ ๊ฐ๋ฅ (์คํ ๋น๊ต์ฉ).
|
| 5 |
+
|
| 6 |
+
์ ์ญ trace list (`LAST_CRAG_TRACE`)์ CRAG ๋ฉํ๊ฐ ๋์ ๋์ด agent ํธ์ถ๋ณ ๊ด์ฐฐ ๊ฐ๋ฅ.
|
| 7 |
"""
|
| 8 |
+
from agents.rag.crag import crag_enabled, crag_search
|
| 9 |
from agents.rag.store import load_document, search
|
| 10 |
|
| 11 |
+
# ํธ์ถ ๋จ์๋ก reset ํ agent loop ๋์ CRAG ๋์์ ์ถ์
|
| 12 |
+
LAST_CRAG_TRACE: list[dict] = []
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def reset_crag_trace() -> list[dict]:
|
| 16 |
+
"""์ด์ trace ํ์ ํ ์๋ก ์์ - ์คํยทagent trace ์์ง์ฉ"""
|
| 17 |
+
global LAST_CRAG_TRACE
|
| 18 |
+
out = LAST_CRAG_TRACE
|
| 19 |
+
LAST_CRAG_TRACE = []
|
| 20 |
+
return out
|
| 21 |
+
|
| 22 |
|
| 23 |
def search_knowledge(query: str, top_k: int = 3) -> dict:
|
| 24 |
+
"""์ฌ๋ด ์ง์ ๋ฌธ์๋ฅผ hybrid ๊ฒ์ + CRAG ์์ฒด ํ๊ฐ
|
| 25 |
|
| 26 |
+
CRAG ํ์ฑ ์ ๋ฐํ์ relevance_score, refined ์ฌ๋ถ ํฌํจ.
|
| 27 |
"""
|
| 28 |
+
if crag_enabled():
|
| 29 |
+
result = crag_search(query, top_k=top_k, trace_list=LAST_CRAG_TRACE)
|
| 30 |
+
return result
|
| 31 |
+
# CRAG ๋นํ์ฑ: ๊ธฐ์กด hybrid search ๊ทธ๋๋ก
|
| 32 |
doc_ids = search(query, top_k=top_k)
|
| 33 |
hits = []
|
| 34 |
+
for d in doc_ids:
|
| 35 |
+
text = load_document(d)
|
| 36 |
+
hits.append({"doc_id": d, "snippet": text[:400] + ("..." if len(text) > 400 else "")})
|
|
|
|
| 37 |
return {"hits": hits}
|
| 38 |
|
| 39 |
|
|
|
|
| 43 |
"name": "search_knowledge",
|
| 44 |
"description": (
|
| 45 |
"์ฌ๋ด ์ง์ ๋ฌธ์(๊ณผ๊ฑฐ ์ฌ๋ก INC, ์คํจ ๋ชจ๋ FMEA, ํ์ค ์ ์ฐจ SOP, ๊ณต์ ํ๋ฆ FLOW)๋ฅผ "
|
| 46 |
+
"hybrid ๊ฒ์ํฉ๋๋ค. CRAG self-correction์ด ํ์ฑํ๋์ด ์์ด ๊ฒ์ ๊ฒฐ๊ณผ์ ๊ด๋ จ์ฑ์ด "
|
| 47 |
+
"๋ฎ์ผ๋ฉด ์๋์ผ๋ก ์ฟผ๋ฆฌ๋ฅผ ์ฌ์์ฑํด ์ฌ๊ฒ์ํฉ๋๋ค. ๋ฐํ ๊ฐ์ relevance_score(0~1)๊ฐ ํฌํจ๋์ด "
|
| 48 |
+
"์์ธ ๋ถ์ยท๋์ ๊ถ๊ณ ์ ์ ๋ขฐ๋์ ํจ๊ป ํ์ฉํ ์ ์์ต๋๋ค."
|
| 49 |
),
|
| 50 |
"parameters": {
|
| 51 |
"type": "object",
|