sinanuozdemir / quick-start-guide-to-llms

The Official Repo for "Quick Start Guide to Large Language Models"
https://www.amazon.com/quick-start-guide-language-models/dp/0138199191
184 stars 91 forks source link

[Link Error] get_best_result_from_pinecorn() method is ouccred error using invaild link #19

Open gayakps opened 1 month ago

gayakps commented 1 month ago

Hello I'm learnig llms student, I follow this examples and then study that but link error ouccred

I'm using this code

def get_best_result_from_pinecone(query, namespace=NAMESPACE): payload = json.dumps({ "num_results": 2, "query": query, "re_ranking_strategy": "none", "namespace": namespace })

response = requests.post(
    "https://information-retrieval-hiaa.onrender.com/document/retrieve",
    data=payload
)

# 디버깅을 위한 응답 상태 및 내용 출력
print("Response status code:", response.status_code)
print("Response JSON content:", response.json())

# 응답이 성공적이고 documents 리스트가 비어있지 않은지 확인
documents = response.json().get('documents', [])
if not documents:
    raise ValueError("No documents found in the response.")

return documents[0]

but this 'https://information-retrieval-hiaa.onrender.com/document/retrieve' link is show below that

image

AAuhsoj commented 1 month ago

I have the same problem. :(

sinanuozdemir commented 1 month ago

Hey! Thanks so much for flagging this, I had to update the API to use some newer libraries. I'm a one person shop here maintaining this so your comments really help me get things moving. I'm now able to get results from the API here :) if you both see the same, I can close this!

The updated code for the API is here: https://github.com/sinanuozdemir/quick-start-llms-ir-fastapi

Screenshot 2024-08-12 at 9 15 55 AM
AAuhsoj commented 1 month ago

I really appreciate your quick response :)

I get the same result yours!! image


The problem has been solved, unfortunately, URL you told about API responses 404 error https://github.com/sinanuozdemir/quick-start-llms-ir-fastapi

image

If this problem is solved, I have no further comment on this issue.

Thanks you for your help and have a nice day!!

gayakps commented 1 month ago

Thanks !!