제가 중국 상해에 거주하고 있습니다. SKT 사태로 유심 보호 서비스를 했고, 자동으로 해외로밍으로 핸드폰이 잠긴 상태입니다. 이런 인증의 경우가 필요해 해제를 해보려고 했지만, 핸드폰 인증이 필수 필요한 상황이라, 한국 상황만 고려, 해외에 있는 저 같은 고객은 해제 조차도 못하는 상황입니다. 공식적으로 SKT에 항의 문의와 답변을 기다리는 중입니다. 여름 휴가기간이나 되어야 한국에 나갈 것 같아.. 요청드려 봅니다. 핸드폰 인증의 절차를 요구하시는 것은 이해가 되지만, 제 강의 수강 신청 상태를 확인하시고, 제 개인 메일로 PDF와 JSON 워크플로우를 공유해 주실수는 없을까요 ? kinghm10@naver.com
안녕하세요, 강의들으면서 도움 많이 받고 있습니다. Pinecone API를 .env에 적었지만 인식을 못해서 하기와 같이 직접적으로 입력해주었습니다. 그런데 하기 부분에서 또 다시 정의가 안 되었다고 에러가 뜹니다. 어디를 수정해야할까요? 커널?을 껐다켰다하면 되는 분도 있다고 해서 따라해봤는데 잘 안 되는 것 같습니다.ㅠ
안녕하세요, 3.2 RAG구성 강의 중 하기 부분에서 막혔습니다. 조언 요청드립니다. OpenAI 대신, Upstage를 쓰고 싶어 하기와 같이 코드 수정을 하였습니다. 그런데 두번째 캡쳐 그림 부터 에러가 발생합니다. Upstage가 유효하지 않다고 하는 것 같은데... 무엇이 잘못된 것 일까요? 그리고 실습을 위해 OpenAI를 결제해야한다면 얼마정도 하면, 완강하는데 문제없을까요?! Error code: 400 - {'error': {'message': 'The requested model is invalid or no longer supported. You can find the list of available models on our models page ( https://console.upstage.ai/docs/models )', 'type': 'invalid_request_error', 'param': '', 'code': 'invalid_request_body'}}
안녕하세요 강의 보다가 헷갈리는 부분이 있어서 질문드립니다 질문1. 3.3 LangGraph에서 도구(tool) 활용 방법 아래 agent 함수는 여러번 호출되는데 리턴하는 부분에서 새로운 배열을 만드는것 처럼 보이지만 add_messages에 의해 자동으로 누적되어 멀티턴 대화가 된다고 이해하면 맞을까요? def agent(state: MessagesState) -> MessagesState: """ 에이전트 함수는 주어진 상태에서 메시지를 가져와 LLM과 도구를 사용하여 응답 메시지를 생성합니다. Args: state (MessagesState): 메시지 상태를 포함하는 state. Returns: MessagesState: 응답 메시지를 포함하는 새로운 state. """ # 상태에서 메시지를 추출합니다. messages = state['messages'] # LLM과 도구를 사용하여 메시지를 처리하고 응답을 생성합니다. response = llm_with_tools.invoke(messages) # 응답 메시지를 새로운 상태로 반환합니다. return {'messages': [response]} 질문2. 3.5 Agent의 히스토리를 관리하는 방법 MemorySaver()의 목적은 주피터 노트북 각 블록을 사용하는데 있어 그 전에 실행해서 얻은 message를 메모리에 저장후 다음 요청 (update_query)에 반영하기 위해 사용된게 맞을까요?
from langchain_core.messages import SystemMessage def agent(state: AgentState) -> AgentState: """ 주어진 `state`에서 메시지를 가져와 LLM과 도구를 사용하여 응답 메시지를 생성합니다. Args: state (AgentState): 메시지 기록과 요약을 포함하는 state. Returns: MessagesState: 응답 메시지를 포함하는 새로운 state. """ # 메시지와 요약을 state에서 가져옵니다. messages = state['messages'] summary = state['summary'] # 요약이 비어있지 않으면, 요약을 메시지 앞에 추가합니다. if summary != '': messages = [SystemMessage(content=f'Here is the summary of the earlier conversation: {summary}')] + messages # LLM과 도구를 사용하여 메시지에 대한 응답을 생성합니다. response = llm_with_tools.invoke(messages) # 응답 메시지를 포함하는 새로운 state를 반환합니다. return {'messages': [response]} 부분에 summary = state['summary'] agent시작하자마자 summary를 넣게되는데 해당 소스부분은 몇 번을 질문해도 처음에는 빈값이 들어가는게 맞나요? summary를 연속질문에 처음 시작 부터 적용하기 위해서는 아래처럼 session정보를 받아서 처리해야하는지 궁금합니다. from langchain_core.messages import HumanMessage query = '안녕' for chunk in graph.stream({'messages': [HumanMessage(query)], 'summary': graph.get_state(config).values['summary']}, config=config, stream_mode='values'): chunk['messages'][-1].pretty_print()
문제 / 오류 / 질문에 대해 설명해 주세요 HTTP Request 강좌를 따라하는 중에 12:30 즘에서 openAI API를 입력하고 Test step을 눌렀습니다. 하지만, 다과 같은 에러가 작성하였습니다. 오류 메시지가 있다면 작성해 주세요 The service is receiving too many requests from you You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors . { "errorMessage": "The service is receiving too many requests from you", "errorDescription": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors .", "errorDetails": { "rawErrorMessage": [ "Try spacing your requests out using the batching settings under 'Options'" ], "httpCode": "429" }, "n8nDetails": { "nodeName": "HTTP Request", "nodeType": "n8n-nodes-base.httpRequest", "nodeVersion": 4.2, "itemIndex": 0, "time": "2025. 5. 21. 오후 9:12:44", "n8nVersion": "1.93.0 (Self Hosted)", "binaryDataMode": "default", "stackTrace": [ "NodeApiError: The service is receiving too many requests from you", " at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:615:21)", " at processTicksAndRejections (node:internal/process/task_queues:95:5)", " at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:696:27)", " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:930:51", " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1266:20" ] } } 사용 중인 워크플로우를 공유해 주세요 HTTP Request 강좌 실습 중 n8n 설치 정보 안내 n8n 버전: 1.93.0 데이터베이스 종류 (기본값: SQLite): n8n 실행 프로세스 설정 (기본값: own, main): n8n 실행 방식 (예: Docker, npm, n8n cloud, 데스크탑 앱 등): Docker 운영 체제: Win 11 Pro
모두를 위한 대규모 언어 모델 LLM Part 5 - LangGraph로 나만의 AI 에이전트 만들기
안녕하세요.. 수업노트에 있는 storm colab 파일을 따라 하는데.. import json from langchain_core.runnables import RunnableConfig async def gen_answer( state: InterviewState, config: Optional[RunnableConfig] = None, name: str = "Subject_Matter_Expert", max_str_len: int = 15000, ): swapped_state = swap_roles(state, name) # Convert all other AI messages # 쿼리 생성 queries = await gen_queries_chain.ainvoke(swapped_state) query_results = await search_engine.abatch( queries["parsed"].queries, config, return_exceptions=True ) successful_results = [ res for res in query_results if not isinstance(res, Exception) ] # url와 콘텐츠 추출 all_query_results = { res["url"]: res["content"] for results in successful_results for res in results } # We could be more precise about handling max token length if we wanted to here dumped = json.dumps(all_query_results)[:max_str_len] ai_message: AIMessage = queries["raw"] tool_call = queries["raw"].tool_calls[0] tool_id = tool_call["id"] tool_message = ToolMessage(tool_call_id=tool_id, content=dumped) swapped_state["messages"].extend([ai_message, tool_message]) # Only update the shared state with the final answer to avoid # polluting the dialogue history with intermediate messages generated = await gen_answer_chain.ainvoke(swapped_state) cited_urls = set(generated["parsed"].cited_urls) # Save the retrieved information to a the shared state for future reference cited_references = {k: v for k, v in all_query_results.items() if k in cited_urls} formatted_message = AIMessage(name=name, content=generated["parsed"].as_str) return {"messages": [formatted_message], "references": cited_references} 이 부분에서 궁금한 것이 생겼습니다. 중간에 tool_call = queries["raw"].tool_calls[0] tool_id = tool_call["id"] 중간에 tool_calls 관련 정보를 호출하는데..그럴려면 gen_queries_chain 이 체인에 tool_bind된 llm이 사용되어야 하는 것 아닌가요? duckduckgo 관련 search_engine함수를 @tool을 이용해서 tool로 선언한 것 같은데.. 해당 퉁을 llm에 바인딩하는 것을 못보아서.. tool index 부분에서 Cell In[46], line 30, in gen_answer(state, config, name, max_str_len) 28 dumped = json.dumps(all_query_results)[:max_str_len] 29 ai_message: AIMessage = queries["raw"] ---> 30 tool_call = queries["raw"].tool_calls[0] 31 tool_id = tool_call["id"] 32 tool_message = ToolMessage(tool_call_id=tool_id, content=dumped) IndexError: list index out of range 가 발생하는 것 같습니다. 어떻게 수정하면 되는지 알려주세요..
os: 윈도우10입니다 uv version: uv 0.7.5 (9d1a14e1f 2025-05-16) x Failed to build `uvloop==0.21.0` |-> The build backend returned an error `-> Call to `setuptools.build_meta.build_wheel` failed (exit code: 1) [stderr] Traceback (most recent call last): File "<string>", line 14, in <module> requires = get_requires_for_build({}) File "C:\Users\wyhil\AppData\Local\uv\cache\builds-v0\.tmpwlGSc0\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\wyhil\AppData\Local\uv\cache\builds-v0\.tmpwlGSc0\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\wyhil\AppData\Local\uv\cache\builds-v0\.tmpwlGSc0\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 8, in <module> import setuptools.build_meta as backend ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: uvloop does not support Windows at the moment hint: This usually indicates a problem with the package or the build environment.
Upstage의 모델을 사용하는데 답변의 정확성이 떨어지는 것 같습니다. 아래 캡처 화면을 보면 retriever가 페이지를 가져오는 것 까지는 괜찮아 보이는데, 가져온 문서의 내용을 적용하여 계산하는 것, 그리고 심지어 기본적인 수학적 계산도 종종 오류를 냅니다 ㅜㅜ 더 정확한 답변을 내도록 할 방법이 있을까요?
markdown(md) 을 text(txt) 로 변환한 다음에 load 하고 split 을 해줘야함 txt 로 변환된 건 langchain 의 textloader 를 써서 load 해야함 이때, utf-8로 encoding 된 txt 파일을 langchain_community 로 TextLoader 하려고 할때 encoding 을 안쓰게 되면 cp949 에러가 나게 됩니다. 너무 기초적인 질문이라 질문글에 없는 것 같아 혹시 저같은 초보를 위해 기록을 남겨 둡니다.^^ (참고로 저는 윈도우 환경으로 따라 하고 있는 중 입니다) from langchain_community.document_loaders import TextLoader loader = TextLoader(text_path, encoding='utf-8') # ✅ 인코딩 명시 document_list = loader.load_and_split(text_splitter) 또한 윈도우에서 uv.lock 을 읽어들일수가 없었는데요... 혹시 윈도우에서도 가능하셔서 하신분 계시면 노하우(?) 부탁드릴게요~
모두를 위한 대규모 언어 모델 LLM Part 5 - LangGraph로 나만의 AI 에이전트 만들기
안녕하세요.. Plan and Executor 아키텍처에서는 Planning 하고 하나의 태스크를 실행하고, 그리고 다시 Replanning 에이전트를 거치면서 답변을 만들어 가는데, ReWoo 아키텍처에서는 RePlanning 과정에 대한 설명이 없던데.. 그렇다면 ReWoo 아키텍처의 Planner 에이전트 성능이 좋아서 모든 게획을 세운것처럼 보이는데. Plan and Executor의 Planner 에이전트도 모든 계획을 세운 것이 아닌건가요? 둘사이 프롬프트가 달라서 그런건가요? ReWoo에서는 왜 재계획 에이전트가 필요없는건가요?
최신 버전 LangChain 문서의 <How to add chat history> 부분이 강의 영상이랑 대부분 다른 것 같은데 강의 영상 코드 기준으로 진행해도 문제가 없을까요?( https://python.langchain.com/docs/how_to/qa_chat_history_how_to/#chains )
@tool def retriever_tool(query: str) -> str: """사용자의 질문에 기반하여 벡터 스토어에서 회사 HR 문서를 검색합니다. 이 도구는 RAG(Retrieval Augmented Generation) 방식을 사용하여: 가장 적합한 문서를 찾아냅니다. Args: query (str): 사용자의 질문 (미리 정의된 질문이 사용됨) Returns: str: 문서 내용 """ _response = _retriever.invoke(query) return _response _research_tools = [retriever_tool] _research_agent = create_react_agent( llm, tools=_research_tools, state_modifier='당신은 HR 담당자 입니다. 의견이 아닌 사실만 제공하세요' ) def _db_research_node(state: MainState) -> Command[Literal["supervisor_node"]]: """ HR 조사 node입니다. 주어진 State를 기반으로 HR 조사 에이전트를 호출하고, 결과를 supervisor node로 전달합니다. Args: state (MainState): 현재 메시지 상태를 나타내는 객체입니다. Returns: Command: supervisor node로 이동하기 위한 명령을 반환합니다. """ result = _research_agent.invoke({"messages" : state["messages"]}) print(f" db result : {result}") return Command( update={'messages': [HumanMessage(content=result['messages'][-1].content, name='db_research')]}, goto='supervisor_node' ) 이런 간단한 create_react_agent를 이용한 agent를 pip 버전이 약간다른 서로다른 pc에서 실행을 하였습니다. 첫 번째 피시에서는 LLM이 대답을 정말잘하지만 두 번째 피시에서는 전혀 엉뚱한 답변을 하며 정답률이 0%에 가깝게 나옵니다. from langgraph.prebuilt import create_react_agent 이런 패키지 버전에 따라서 LLM의 추론 생각 능력 차이가 있나요? LLM과 vectordb, embedding 모델, 소스는 동일합니다. 피시 사양도 똑같고 langraph 패키지 버전차이만 존재합니다.
안녕하세요.. langgraph 에서 graph_builder를 이용하여 노드와 엣지를 추가한 후에 compile한 후에 생성된 구조를 이미지로 표현하는 부분에서 오류가 발생합니다. 혹시 이 오류가 왜 발생하는지, 어떻게 수정해야 하는지 알려주시면 좋겠습니다 from IPython.display import Image, display display(Image(graph.get_graph().draw_mermaid_png())) 이 부분을 실행하게 되면 다음과 같은 오류가 발생합니다. TimeoutError Traceback (most recent call last) File ~/Workspace/pythonprj/langgraphtutorial/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py:534 , in HTTPConnectionPool._make_request (self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 533 try: --> 534 response = conn.getresponse() 535 except (BaseSSLError, OSError) as e: ....... ValueError: Failed to reach https://mermaid.ink/ API while trying to render your graph after 1 retries. 이미지를 생성하는데 다른 사이트로 요청을 하는 것 같은데..timeout 오류가 발생하네요..