Skip to content

Commit ebdbdb3

Browse files
authored
Revert "feat(news_qa_agent): implement passage ranking and citation system"
1 parent bdbd0ac commit ebdbdb3

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

Jujutsu_Quants/app/adk/agents/news_qa_agent.py

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,52 +29,17 @@
2929

3030
from app.config.adk_config import AGENT_CONFIGS
3131

32-
# --- Type Definitions for API Contract ---
33-
34-
class Passage(TypedDict):
35-
text: str
36-
source: str
37-
start: int
38-
end: int
39-
40-
class Citation(TypedDict):
41-
source: str
42-
start: int
43-
end: int
44-
45-
class RankedPassage(TypedDict):
46-
passage: Passage
47-
score: float
48-
49-
class Answer(TypedDict):
50-
answer: str
51-
citations: List[Citation]
52-
53-
54-
# --- Default Constants ---
55-
56-
DEFAULT_CHUNK_SIZE = 150
57-
DEFAULT_CHUNK_OVERLAP = 30
58-
DEFAULT_TOP_K = 3
59-
DEFAULT_MIN_SCORE = 0.05
60-
61-
62-
# --- Agent Instruction ---
63-
6432
QA_INSTRUCTION = """
6533
You are the News QA Agent. Answer user questions using the provided news corpus.
6634
Be concise and cite the article titles in your answer.
6735
If no relevant answer is found, reply with 'No relevant article found.'
6836
"""
6937

70-
71-
# --- Factory Function ---
72-
7338
def create_news_qa_agent():
7439
config = AGENT_CONFIGS["news_qa_agent"]
7540

7641
class NewsQAAgent:
77-
def _init_(self):
42+
def __init__(self):
7843
self.name = config["name"]
7944
self.model = config["model"]
8045
self.description = config["description"]
@@ -270,4 +235,4 @@ def answer(self, articles, question):
270235
}
271236
]
272237
result = agent.answer(articles, "What did Apple report about earnings?")
273-
print(result)
238+
print(result)

0 commit comments

Comments
 (0)