-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/fix unanswered queries #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5a5407a
8a01e1d
133442a
43d1722
0dd84a4
3057ad7
fc24774
cdbc817
6c7566d
78fc51a
9de894d
3d773d7
4335bee
7298aac
30dd215
ce91d6a
0bd1fcd
1196e30
1b31b83
e1ec3fc
36bd572
f13f327
1a9358b
5d2841d
2584e3b
2395400
a0f719c
789bdf4
4c33094
c9b0b91
f24b224
622a663
9eedd78
4d878c2
8495460
110049b
105a59c
7d918eb
382f90e
1987897
f11491c
cad791b
e94fbe2
359511c
f187cb1
95be5fa
2c0f465
bfe167c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -124,15 +124,20 @@ async def get_response_stream_async(context: str, query: str, history: str = "") | |||||
| prompt = get_rag_prompt() | ||||||
| chain = prompt | get_llm() | StrOutputParser() | ||||||
| generator = chain.astream({"context": context, "chat_history": history, "query": query}) | ||||||
| while True: | ||||||
| try: | ||||||
| chunk = await asyncio.wait_for(generator.__anext__(), timeout=30.0) | ||||||
| yield chunk | ||||||
| except StopAsyncIteration: | ||||||
| break | ||||||
| except asyncio.TimeoutError: | ||||||
| print("LLM stream chunk timed out after 30 seconds.") | ||||||
| raise | ||||||
| try: | ||||||
| while True: | ||||||
| try: | ||||||
| chunk = await asyncio.wait_for(generator.__anext__(), timeout=30.0) | ||||||
| yield chunk | ||||||
| except StopAsyncIteration: | ||||||
| break | ||||||
| except asyncio.TimeoutError: | ||||||
| import logging | ||||||
| logger = logging.getLogger(__name__) | ||||||
| logger.warning(f"LLM stream chunk timed out after 30 seconds. Query: {query}") | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 타임아웃 로그에 사용자 질의 원문을 남기지 마세요. Line 137은 사용자 입력을 그대로 로그에 기록하고 있어 운영 로그에 민감정보가 저장될 수 있습니다. 원문 대신 비식별 정보만 남기도록 바꿔주세요. 🔧 수정 예시- logger.warning(f"LLM stream chunk timed out after 30 seconds. Query: {query}")
+ logger.warning("LLM stream chunk timed out after 30 seconds")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| raise | ||||||
| finally: | ||||||
| await generator.aclose() | ||||||
|
|
||||||
| title_prompt = PromptTemplate.from_template( | ||||||
| """주어진 질문을 기반으로 철학적인 대화방 제목을 15자 이내로 지어줘. | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.