패키지 설치: poetry add python-dotenv langchain langchain_openai gradio 위를 입력하는데, 아래 처럼 같은 에러가 수십번 납니다 PS D:\mypersonal\myprojects\LANGCHAIN\qa-bot> poetry add python-dotenv langchain langchain-openai gradio Using version ^1.1.1 for python-dotenv Using version ^0.3.26 for langchain Using version ^0.3.27 for langchain-openai Using version ^5.35.0 for gradio Updating dependencies Resolving dependencies... (1.1s) The current project's supported Python range (>=3.10) is not compatible with some of the required packages Python requirement: - langchain-text-splitters requires Python <4.0,>=3.9, so it will not be installable for Python >=4.0 Because no versions of langchain match >0.3.26,<0.4.0 and langchain (0.3.26) depends on langchain-text-splitters (>=0.3.8,<1.0.0), langchain (>=0.3.26,<0.4.0) requires langchain-text-splitters (>=0.3.8,<1.0.0). Because langchain-text-splitters (0.3.8) requires Python <4.0,>=3.9 and no versions of langchain-text-splitters match >0.3.8,<1.0.0, langchain-text-splitters is forbidden. Thus, langchain is forbidden. So, because qa-bot depends on langchain (^0.3.26), version solving failed. * Check your dependencies Python requirement: The Python requirement can be specified via the python or markers properties For langchain-text-splitters, a possible solution would be to set the python property to ">=3.10,<4.0"
그대로 따라하고 실행했는데 이런 문제점이 있습니다. 왜인지 잘 모르겠어요. 44강에서 테스트 메세지의 링크가 모바일에서도 안나옵니다. 44강에서 위치보기 도 누르면 아무 링크가 안열립니다. 45강에서 PC카톡에 "안녕하세요. 봇입니다." 라는 메세지를 보내면, 계속 이렇게 나오네요.
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. 이런 에러가뜹니다.. 미치겠네요..
실행 시 에러 나는데 무슨 문제일까요? 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'}}
소스대로 했는데 에러가 생기네요 78, 79 번째줄 text 에서 에러입니다. 에러 메세지는 Running Gradle task 'assembleDebug'... lib/chat_page.dart:78:63: Error: The getter 'text' isn't defined for the class 'Part'. - 'Part' is from 'package:flutter_gemini/src/models/part/part.dart' ('/C:/Users/userpc/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_gemini-3.0.0/lib/src/models/part/part.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. ? HumanMessage(content: chat.parts?.first.text ?? '') ^^^^ lib/chat_page.dart:79:60: Error: The getter 'text' isn't defined for the class 'Part'. - 'Part' is from 'package:flutter_gemini/src/models/part/part.dart' ('/C:/Users/userpc/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_gemini-3.0.0/lib/src/models/part/part.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. : AIMessage(content: chat.parts?.first.text ?? ''); ^^^^ Target kernel_snapshot failed: Exception FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 4s Exception: Gradle task assembleDebug failed with exit code 1 혹시 25, 34 번째줄 Parts 에 안쓴다는 줄 쳐졌는데 관계가 있나요
안녕하세요. 강의를 듣고 추가적으로 공부를 하려고 하는데 예를 들어 Q. 테슬라의 창업자는 누구야 A. 테슬라의 창업자는 OOO입니다. 이러한 대화 바로 다음 OOO에 관련한 추가 질문을 하려고합니다. 예시) Q. 그렇다면 그 사람에 대해서 간단하게 설명해줘. 위 질문을 하려면 LLM이 이전대화내용을 기억해야하는데 그것에 대해서 공부하려합니다. 키워드를 뭐라고 잡아야할까요?
초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
계속해서 인터프리터를 찾지 못해서 루트 경로에 .vscode폴더를 만들고 settings.json파일을 생성후, { "python.defaultInterpreterPath": "${workspaceFolder}/ch02_env/bin/python" } 해당 코드를 넣어 강제로 인식하게 했는데, 인터프리터 인식이 되었습니다..
from langchain.retrievers.document_compressors import DocumentCompressorPipeline from langchain_community.document_transformers import EmbeddingsRedundantFilter # 중복 문서 제거 redundant_filter = EmbeddingsRedundantFilter(embeddings=embeddings_model) # 쿼리와 관련성이 높은 문서만 필터링 relevant_filter = EmbeddingsFilter(embeddings=embeddings_model, similarity_threshold=0.5) # Re-ranking re_ranker = LLMListwiseRerank.from_llm(llm, top_n=2) pipeline_compressor = DocumentCompressorPipeline( transformers=[redundant_filter, relevant_filter, re_ranker] ) pipeline_compression_retriever = ContextualCompressionRetriever( base_compressor=pipeline_compressor, base_retriever=chroma_db.as_retriever() ) question = "테슬라 회장은 누구인가요?" compressed_docs = pipeline_compression_retriever.invoke(question) print(f"쿼리: {question}") print("검색 결과:") for doc in compressed_docs: print(f"- {doc.page_content} [출처: {doc.metadata['source']}]") print("-"*100) print() `(4) DocumentCompressorPipeline` - 여러 압축기를 순차적으로 결합하는 방식 - BaseDocumentTransformers를 추가하여, 문서를 더 작은 조각으로 나누거나 중복 문서를 제거하는 등의 작업도 가능 여기에서 result = chain.invoke() 로 받아서 result의 데이터를 보면, context = result['context'][i] query_similarity_score = context.state['query_similarity_score'] 이렇게 similarity_score 처럼 rerank score같은거 보고싶은데, # 크로스 인코더를 사용하여 유사성 점수를 계산합니다. sentence_pairs = [[query, prediction]] similarity_scores = cross_encoder_model.predict(sentence_pairs) 이런식으로 계산을 해야하나요? 추출하고 싶은데 방법을 잘 모르겠습니다.
초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
가상환경을 종료하려고 Deactivate 명령어를 입력하면 다음과 같은 문구가 뜨면서 종료가 되지 않습니다. deativate : 'deativate' 용어가 cmdlet, 함수, 스크립트 파일 또는 실행할 수 있는 프로그램 이름으로 인식되지 않습니다. 이름이 정확한지 확인하고 경로가 포함된 경우 경로가 올바른지 검증한 다음 다시 시도하십시오. 위치 줄:1 문자:1 + deativate + ~~~~~~~~~ + CategoryInfo : ObjectNotFound: (deativate:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException