inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

numpy 설치 에러

해결됨

AI 에이전트로 구현하는 RAG 시스템(w. LangGraph)

강의 시점: 섹션1 > 실습을 위한 환경 설정 방법에서 약 1분 16초 내용: 제공해주신 pyproject.toml에서 저는 파이썬 3.13 버전으로 설치되어 이 부분만 수정해 install하였습니다. 그랬더니 아래와 같이 numpy 설치 에러 문구가 뜨는데 왜 그런걸까요? 해결 방법이 있을까요? 에러 메시지 - Installing numpy (1.26.4): Failed PEP517 build of a dependency failed Backend subprocess exited when trying to invoke build_wheel Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with numpy (1.26.4) - not supporting PEP 517 builds - not specifying PEP 517 build requirements correctly - the build requirements are incompatible with your operating system or Python version - the build requirements are missing system dependencies (eg: compilers, libraries, headers). You can verify this by running pip wheel --no-cache-dir --use-pep517 "numpy (==1.26.4)".

  • llm
  • langchain
  • rag
  • ai-agent
  • langgraph
정다연 댓글 1 좋아요 0 조회수 561

embedding 과정 중 Error, message length too large 발생

미해결

RAG를 활용한 LLM Application 개발 (feat. LangChain)

안녕하십니까 강의 잘 듣고있습니다.! from langchain_ollama import OllamaEmbeddings embeddings = OllamaEmbeddings(model="llama3.2") import os from pinecone import Pinecone from langchain_pinecone import PineconeVectorStore index_name = "tax-table-index" pinecone_api_key = os.environ.get("PINECONE_API_KEY") pc = Pinecone(api_key=pinecone_api_key) database = PineconeVectorStore.from_documents(document_list, embedding=embeddings, index_name=index_name) Embedding 후 PinecondVectorStore 저장 할떄 아래와 같은 예외가 발생합니다. ``` PineconeApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 17 Apr 2025 02:53:26 GMT', 'Content-Type': 'application/json', 'Content-Length': '118', 'Connection': 'keep-alive', 'x-pinecone-request-latency-ms': '2664', 'x-pinecone-request-id': '9090329298438964680', 'x-envoy-upstream-service-time': '2', 'server': 'envoy'}) HTTP response body: {"code":11,"message":"Error, message length too large: found 4194738 bytes, the limit is: 4194304 bytes","details":[]} Output is truncated. View as a scrollable element or open in a text editor. ``` OllamaEmbeddings(model="llama3.2") 를 사용하고 있는데요. 해당 모델로 임베딩을 하면 Pinecone에서 허용하는 데이터를 초과하는 것 으로 보이는데요 이러한 경우 처리하는 방법이 있을까요? 아니면 모델을 변경해야하는 걸까요?

  • vector-database
  • llm
  • langchain
  • rag
  • openai-api
rhsnqk 댓글 4 좋아요 0 조회수 501

맞는 답변은 5,000만원 이하에 대한 내용이어야 할것 같아요

해결됨

RAG를 활용한 LLM Application 개발 (feat. LangChain)

올려주신 영상에서 LLM 답변이 5,000만원 초과 8,800만원 이하 구간에 대한 내용으로 나왔는데요, 1,400만원 초과 5,000만원 이하 구간에 대한 내용이 나와야 맞는 것 같아요 UpstageEmbeddings 사용하니까 이 구간에 대한 정보로 알려주네요

  • vector-database
  • llm
  • langchain
  • rag
  • openai-api
길태형 댓글 2 좋아요 0 조회수 226

The onnxruntime python package is not installed.

미해결

AI 에이전트로 구현하는 RAG 시스템(w. LangGraph)

'벡터 저장소(Vector Store)를 도구로 변환하기' 강의에서 'from langchain_chroma import Chroma' 부분 실행 시 아래와 같은 오류가 발생합니다. ValueError: The onnxruntime python package is not installed. Please install it with pip install onnxruntime pip install을 수행해도 에러는 동일하게 발생합니다. 구글 검색으로 Microsoft Visual C++ Redistributable 설치도 시도해 보았으나 여전히 동일합니다. 어떻게 해결해야할까요? 필요한 정보가 있다면 알려주세요.

  • llm
  • langchain
  • rag
  • ai-agent
  • langgraph
hipyohip 댓글 1 좋아요 0 조회수 247

섹션 5, 사용자 정의 조건부 엣지 관련 질문입니다.

미해결

AI 에이전트로 구현하는 RAG 시스템(w. LangGraph)

from langgraph.graph import MessagesState, StateGraph, START, END from langchain_core.messages import HumanMessage, SystemMessage from langgraph.prebuilt import ToolNode from IPython.display import Image, display # LangGraph MessagesState 사용 class GraphState(MessagesState): pass # 노드 구성 def call_model(state: GraphState): system_message = SystemMessage(content=system_prompt) messages = [system_message] + state['messages'] response = llm_with_tools.invoke(messages) return {"messages": [response]} def should_continue(state: GraphState): last_message = state["messages"][-1] # 도구 호출이 있으면 도구 실행 노드로 이동 if last_message.tool_calls: return "execute_tools" # 도구 호출이 없으면 답변 생성하고 종료 return END # 그래프 구성 builder = StateGraph(GraphState) builder.add_node("call_model", call_model) builder.add_node("execute_tools", ToolNode(tools)) builder.add_edge(START, "call_model") builder.add_conditional_edges( "call_model", should_continue, { "execute_tools": "execute_tools", END: END } ) builder.add_edge("execute_tools", "call_model") graph = builder.compile() # 그래프 출력 display(Image(graph.get_graph().draw_mermaid_png())) # 그래프 실행 inputs = {"messages": [HumanMessage(content="스테이크 메뉴의 가격은 얼마인가요?")]} messages = graph.invoke(inputs) 위 코드는 강사님께서 제공해주신 코드를 가져온 것입니다. 제가 궁금한 것은 Tool 노드를 사용하고 다시 call_model 노드로 왔을 때 SytemMessage가 중복되지 않을까? 라는 생각을 했습니다. 예를 들어 message : [유저 인풋] 가 처음으로 그래프에 들어오게된다면 def call_model(state: GraphState): system_message = SystemMessage(content=system_prompt) messages = [system_message] + state['messages'] response = llm_with_tools.invoke(messages) return {"messages": [response]} message : SystemMessage + [유저 인풋] 이 될것입니다. 그 이후 response를 호출하여 message : SystemMessage + [유저 인풋] + toolMessage 이 되어 상태를 업데이트 하고, 그리고 tool 콜이 있어서 툴노드를 마무리 한 이후 돌아왔을 땐 GraphState에 있는 message는 SystemMessage + [유저 인풋] + toolMessage + [툴이보낸 메세지] 일테니 call model 노드에서 SystemMessage + SystemMessage + [유저 인풋] + toolMessage + [툴이보낸 메세지] 가 적용되어 툴 콜 할때마다 SytemMessage가 쌓이는 구조가 되지 않을까 생각이 들었는데 맞을까요?

  • llm
  • langchain
  • rag
  • ai-agent
  • langgraph
이성규 댓글 1 좋아요 0 조회수 150

Hugging face LLM 모델 사용 질문이요

미해결

RAG를 활용한 LLM Application 개발 (feat. LangChain)

OpenAI API랑 upstage 말고 hugging face에서 제공하는 LLM 모델을 사용하고 싶은데요 streamlit을 사용해서 출력된 response를 보니 아래와 같은 형태로 출력 되더라구요 사용한 모델명 : microsoft/Phi-3-mini-4k-instruct 인데.. 이 경우, 코드에서 전처리 해줘야 하나요? 제 코드는 아래와 같습니다 [llm.py] def get_llm(): model_id="microsoft/Phi-3-mini-4k-instruct" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, device_map="auto", torch_dtype="auto" ) pipe = pipeline( "text-generation", model=model, tokenizer=tokenizer, max_new_tokens=512, do_sample=False, repetition_penalty=1.03 ) llm = HuggingFacePipeline(pipeline=pipe) # llm = HuggingFacePipeline.from_model_id( # model_id="microsoft/Phi-3-mini-4k-instruct", # task="text-generation", # model_kwargs=dict( # device_map="auto" # ), # pipeline_kwargs=dict( # max_new_tokens=512, # do_sample=False, # repetition_penalty=1.03, # ) # ) chat_model = ChatHuggingFace(llm=llm) return chat_model store = {} def get_session_history(session_id: str)->BaseChatMessageHistory: if session_id not in store: store[session_id] = ChatMessageHistory() return store[session_id] def get_template(): template = """ You are a helpful assistant. Answer the following questions considering the history of the conversation: Chat history : {chat_history} User question : {user_message} Assistant : """ prompt = ChatPromptTemplate.from_template(template) return prompt def get_ai_response(user_message,chat_history): llm = get_llm() prompt = get_template() chain = prompt | llm | StrOutputParser() ai_response = chain.invoke({ "chat_history": chat_history, "user_message": user_message, }) return ai_response [chat.py] if "chat_history" not in st.session_state: st.session_state.chat_history = [ {"role": "ai", "content": "Hello, I am a mini bot. How can I help you?"} ] for message in st.session_state.chat_history: with st.chat_message(message["role"]): st.write(message["content"]) user_question = st.chat_input(placeholder="Tell me a simple question!") if user_question is not None and user_question != "": st.session_state.chat_history.append({"role":"user", "content":user_question}) with st.chat_message("user"): st.markdown(user_question) with st.spinner("Generating response"): ai_response = get_ai_response(user_question, st.session_state.chat_history) with st.chat_message("ai"): st.markdown(ai_response) st.session_state.chat_history.append({"role":"ai", "content":ai_response})

  • llm
  • langchain
댓글 2 좋아요 0 조회수 255

OpenAI API를 활용하여 LLM Chain 구현하기 (실습)

미해결

프로젝트로 배우는 Python 챗봇 & RAG - LangChain, Gradio 활용

OpenAI API를 활용하여 LLM Chain 구현하기 (실습) 에서 llm.invoke(prompt_text)하면 이런에러가뜹니다.. api_key 새로 갱신받아도 계속 이럽니다..

  • 챗봇
  • gradio
  • chatgpt
  • llm
  • langchain
  • rag
  • openai-api
red9123 댓글 3 좋아요 0 조회수 336

OpenAI API를 활용하여 LLM Chain 구현하기 (실습) 에서

미해결

프로젝트로 배우는 Python 챗봇 & RAG - LangChain, Gradio 활용

OpenAI API를 활용하여 LLM Chain 구현하기 (실습) 에서 All attempts to connect to pypi.org failed. Probable Causes: - the server is not responding to requests at the moment - the hostname cannot be resolved by your DNS - your network is not connected to the internet You can also run your poetry command with -v to see more information. 이런 에러가뜹니다.. 미치겠네요..

  • 챗봇
  • gradio
  • chatgpt
  • llm
  • langchain
  • rag
  • openai-api
red9123 댓글 1 좋아요 0 조회수 263

langchain 홈페이지 관련이요

해결됨

RAG를 활용한 LLM Application 개발 (feat. LangChain)

강의중에 들어가시는 langchain 홈페이지가 지금이랑 version이 다른것 같은데 현재 version 홈페이지에서는 강의 내용에 나오는 곳을 찾을 수가 없습니다. 혹시 version이 달라도 괜찮을까요? 예를 들어 Microsoft Word Document loaders를 찾고 싶습니다.

  • vector-database
  • llm
  • langchain
  • rag
  • openai-api
김성현 댓글 2 좋아요 0 조회수 213

혹시 로컬llm을 활용해서 RAG를 구현하는 예제도 한번 올려주시면 안될까요?

미해결

모두를 위한 대규모 언어 모델 LLM(Large Language Model) Part 2 - 랭체인(LangChain)으로 나만의 ChatGPT 만들기

기업이나 연구소에 근무하시면서 상용 llm을 활용해서 서비스를 개발하시는 분들도 많겠지만 로컬pc 24G정도의 vram에 ollama로 Gemma3 27B ( 모델용량 17GB)정도의 모델을 올리면 개인이 가지고 있는 문서들을 따로 토큰을 쓰지않고도 벡터화해서 필요할때 질의응답 하는 용도로 활용가능할거 같은데요 https://m.blog.naver.com/PostView.naver?blogId=se2n&logNo=223625573379&navType=by 강의중에 codeLlama 연동하시는 부분은 봤는데 ollama로 연동하는 방법이 궁금합니다

  • langchain
  • gemma227b6q
  • localllm
  • rag
neyeum 댓글 2 좋아요 0 조회수 1179

No module named 'langchain_chroma' 발생해요

해결됨

RAG를 활용한 LLM Application 개발 (feat. LangChain)

langchain_chroma를 다운로드하면 제대로 설치가 안되는것 같은데 무슨 문제가 있는걸까요?

  • vector-database
  • llm
  • langchain
  • rag
  • openai-api
김성현 댓글 2 좋아요 0 조회수 550

강사님의 LLM 모델의 버전이 어떻게 되나요?

해결됨

AI 에이전트로 구현하는 RAG 시스템(w. LangGraph)

안녕하세요, 강사님 Azure OpenAI API를 사용해 봤는데요. gpt-4o-mini-2024-07-18 입니다. Structured output을 하는 경우 다음과 같은 애러가 발생해요. 모델 버전 문제일 것 같기는 한데요. BadRequestError: Error code: 400 - {'error': {'code': 'BadRequest', 'message': 'response_format value as json_schema is enabled only for api versions 2024-08-01-preview and later'}} 강사님의 LLM 모델의 버전이 어떻게 되나요?

  • llm
  • langchain
  • rag
  • ai-agent
  • langgraph
SPAGGY 댓글 1 좋아요 0 조회수 247

Agent RAG 구현에서 '정보 추출 및 평가' 노드 결과 애러

미해결

AI 에이전트로 구현하는 RAG 시스템(w. LangGraph)

안녕하세요, 강사님. 강의 마지막 섹션 Agent RAG 시스템을 그래프로 구현 에서 # 4. Agent RAG 구현 부분에서 LLM 모델에 따라 결과 다르게 나오는 것 같습니다. 참고로, 저는 ANTHROPIC claude-3-7-sonnet-20250219 모델을 사용하는데요. 다음과 같이, '정보 추출 및 평가' 노드에서 애러가 발생합니다. 안정적인 결과를 얻기 위해서는 어떤 방안이 좋을지 의견을 부탁 드립니다. ---정보 추출 및 평가--- ValidationError: 2 validation errors for ExtractedInformation strips Input should be a valid list [type=list_type, input_value='[\n {\n "content": "...="query_relevance">0.95', input_type=str] For further information visit https://errors.pydantic.dev/2.10/v/list_type query_relevance Field required [type=missing, input_value={'strips': '[\n {\n "..."query_relevance">0.95'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.10/v/missing 수업 영상 몇 분/초 구간인지 알려주세요.

  • llm
  • langchain
  • rag
  • ai-agent
  • langgraph
SPAGGY 댓글 2 좋아요 0 조회수 148

메시지 그래프/피드백 루프 활용하기에서 질문

미해결

AI 에이전트로 구현하는 RAG 시스템(w. LangGraph)

12:20 에서 grade, num_generation 필드값으로 상태값이 덮어 써진다고 하셨는데요. 그러면 기존 상태에 있던 "messages"와 "documents"가 사라지는 건가요? 4:07에서 rag_chain.invoke함수에 string 타입의 query가 들어가면 "context"와 "question"에 모두 입력으로 들어가게 되는건가요?

  • llm
  • langchain
  • rag
  • ai-agent
  • langgraph
junghyun_kwon3 댓글 1 좋아요 0 조회수 136

2-3 임베딩모델 에러

미해결

RAG 마스터: 기초부터 고급기법까지 (feat. LangChain)

실행 시 에러 나는데 무슨 문제일까요? 2.3 임베딩 모델입니다. --------------------------------------------------------------------------- RateLimitError Traceback (most recent call last) Cell In[81], line 6 2 embeddings = OpenAIEmbeddings( 3 model ="text-embedding-3-small", # 사용할 모델 이름을 지정 가능 4 ) 5 sample_text = "테슬라 창업자는 누구인가요?" ----> 6 vector = embeddings.embed_query(sample_text) 7 print(f"임베딩 벡터의 차원: { len(vector)}") File ... (...) 1031 retries_taken =retries_taken, 1032 ) RateLimitError : Error code: 429 - {'error': {'message': '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 .', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

  • python
  • 챗봇
  • llm
  • langchain
  • rag
miracle 댓글 2 좋아요 0 조회수 186

STORM 아키텍쳐

미해결

모두를 위한 대규모 언어 모델 LLM Part 5 - LangGraph로 나만의 AI 에이전트 만들기

Structured output과 regex pattern 설정 충돌 quries["raw"].toll_calls 가 빈 리스트로 반환됨 두 문제 모두 langchain_openai==0.2.4 에서는 정상적으로 동작

  • llm
  • langchain
  • rag
  • openai-api
  • ai-agent
  • langgraph
강경준 댓글 2 좋아요 0 조회수 150

JsonOutputParser

해결됨

한시간으로 끝내는 LangChain 기본기

영상에는 JsonOutputParser가 Json으로 파싱을 못하는 것 같은데 제가 테스트하는 시점에서는 ``` content='{"capital": "Paris", "population": 67867511, "language": "French", "currency": "Euro"}' additional_kwargs={} response_metadata={'model': 'llama3.2', 'created_at': '2025-04-09T06:56:17.010494Z', 'done': True, 'done_reason': 'stop', 'total_duration': 1087877500, 'load_duration': 26809708, 'prompt_eval_count': 62, 'prompt_eval_duration': 576710791, 'eval_count': 27, 'eval_duration': 483715500, 'message': Message(role='assistant', content='', images=None, tool_calls=None), 'model_name': 'llama3.2'} id='run-c9042af5-e5d4-4e27-b2ff-d78c308ec28f-0' usage_metadata={'input_tokens': 62, 'output_tokens': 27, 'total_tokens': 89} ``` --> ``` json {'capital': 'Paris', 'population': 67867511, 'language': 'French', 'currency': 'Euro'} ``` 파싱이 잘 되네요 llama3.2를 사용 중인데 질문에 대한 응답이 잘나와서 그런거지 JsonOutputParser 사용은 여전히 사용하지 않는 것을 추천하실까요?

  • 프롬프트엔지니어링
  • llm
  • langchain
rhsnqk 댓글 1 좋아요 0 조회수 161

안녕하세요. 오늘 커뮤니티에 올라온 서적 예제 4.11관련 질문입니다.

해결됨

입문자를 위한 LangChain 기초 — v1.0+ 업데이트

안녕하세요. 사전 구입하여 책을 읽고있는 한 인원입니다. 다름이아니라 책 102쪽 4.11 예제를 제 컴퓨터에서 하려하는데 다음과같은 오류가 뜹니다. 혹시 버전문제일까요? 지금 버전에서 해당 컨텍스트 길이를 보려면 어떻게 수정해야할까요? 추가적으로 큰 문제는 아니지만 책에 오타있는 부분도 기재합니다. 43페이지 딱히 큰 문제는 아니지만 사소하게 변수명이 잘못적혀있습니다..! 해당 장의 다른 변수들은 모두 맞게 작성되어있지만 해당 부분만 오타가있습니다. 크리티컬한 오타는 아니지만 혹여나 도움이 될까 싶어 기재합니다. 지금 절반 정도 읽었는데 읽는 인원이 최대한 잘 이해하고 어려워하지 않도록 매 개념마다 실습을 진행하고 한줄 한줄 코드 해석해주는 것이 느껴지는 책입니다. 강의 등 랭체인 및 LLM 어플리케이션 개발에 항상 큰 도움을 받고있습니다. 좋은 자료 강의 항상 감사드립니다.

  • python
  • llm
  • langchain
  • openai-api
댓글 2 좋아요 0 조회수 131

3.2 LangChain과 Chroma를 활용한.. 예제중 질문입니다.

미해결

RAG를 활용한 LLM Application 개발 (feat. LangChain)

안녕하세요. 3.2 예제 실습중 아래와 같은 이슈를 해결하지 못하여 질문 드립니다. 사용자 환경운 github 에서 제고해준 code space 환경에서 테스트 중입니다. 오류 코드는.. from langchain_chroma import Chroma # 데이터를 처음 저장할 때 database = Chroma.from_documents(documents=document_list, embedding=embedding, collection_name='chroma-tax', persist_directory="./chroma") 위 코드 실행시 아래와 같은 오류가 발생합니다. AttributeError Traceback (most recent call last) Cell In[108], line 4 1 from langchain_chroma import Chroma 3 # 데이터를 처음 저장할 때 ----> 4 database = Chroma.from_documents(documents=document_list, embedding=embedding, collection_name= 'chroma-tax' , persist_directory= "./chroma" ) 6 # 이미 저장된 데이터를 사용할 때 7 #database = Chroma(collection_name='chroma-tax', persist_directory="./chroma", embedding_function=embedding) File /workspaces/faith79/.venv/lib/python3.12/site-packages/langchain_chroma/vectorstores.py:1239 , in Chroma.from_documents (cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, kwargs) 1237 if ids is None: 1238 ids = [ doc.id if doc.id else str(uuid.uuid4()) for doc in documents] -> 1239 return cls.from_texts( 1240 texts=texts, 1241 embedding=embedding, 1242 metadatas=metadatas, 1243 ids=ids, 1244 collection_name=collection_name, 1245 persist_directory=persist_directory, 1246 client_settings=client_settings, 1247 client=client, 1248 collection_metadata=collection_metadata, 1249 kwargs, 1250 ) ... --> 327 client settings = chromadb.config.Settings(is_persistent=True) 328 client settings.persist_directory = persist_directory 329 else: AttributeError : module 'chromadb' has no attribute 'config' Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings... //////////////////////////////////////////////////////////////////////////////// chromadb 에서 config 속성 사용이 안된다는거 같아요. 그래서 langchain_chroma의 버전도 변경하고 chromadb 도 설치 후 버전도 이것저것 변경해 보았는데, 동일한 이슈만 지속적으로 나오고 있습니다 꼭 해결하고 싶어요~ 도와주세요.

  • vector-database
  • llm
  • langchain
  • rag
  • openai-api
dglee 댓글 2 좋아요 0 조회수 341

llm 모델 사용 관련 질문 있습니다.

미해결

입문자를 위한 LangChain 기초 — v1.0+ 업데이트

랭체인_Runnable~~ 마지막 강좌에서 llm 모델 사용 관련해 model을 "qwen2.5:14b"와 "deepseek " model을 사용한 특별한 이유라도 있는지요. 대체할만한 다른 model이 있으면 추천해 주세요.

  • python
  • llm
  • langchain
  • openai-api
니모 댓글 3 좋아요 0 조회수 226

인기 태그

인프런 TOP Writers

주간 인기글