mongulu-cm / tchoung-te

Map of Cameroonian associations in France
https://tchoung-te.mongulu.cm/
GNU General Public License v3.0
1 stars 0 forks source link

Create a chat app like chatgpt to allow search in the database v1 #63

Closed billmetangmo closed 6 months ago

billmetangmo commented 1 year ago

Multiples ways of solving:

billmetangmo commented 1 year ago

Create a simple data app for the first version using streamlit

billmetangmo commented 1 year ago

Python libraries for action-oriented LLMs: https://www.youtube.com/watch?v=XgD5AuzBvs8

billmetangmo commented 1 year ago

Search using the relevant documents provided by semantic search: may be we can use embedding then search using OpenAI ? https://learnprompting.org/docs/applied_prompting/build_chatbot_from_kb ?

billmetangmo commented 12 months ago

Vue des tâches: https://www.loom.com/share/0f04f92d3c254fa4bcfc367121982c8a

KameniAlexNea commented 9 months ago

Here's a formatted explanation of the traceback for other developers:

Traceback (most recent call last):
  File "/home/eak/Documents/AI/DeepLearning/tchoung-te/.venv/bin/chainlit", line 8, in <module>
    sys.exit(cli())
  ...
  ...
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for StuffDocumentsChain
__root__
  document_variable_name summaries was not found in llm_chain input_variables: ['context', 'question'] (type=value_error)

This is the part of the code that failed:

llm = ChatOpenAI(max_tokens=500, temperature=0, model_name="gpt-3.5-turbo")
chain_type_kwargs = {"prompt": CHAT_PROMPT}
qa = RetrievalQAWithSourcesChain.from_chain_type(
    llm=llm,
    chain_type="stuff",
    retriever=vectors.as_retriever(search_kwargs={"k": 3}),
    chain_type_kwargs=chain_type_kwargs,
    return_source_documents=True
)

The traceback indicates an error in the code, specifically in the part where you're initializing the qa object. The error message (pydantic.error_wrappers.ValidationError) suggests that there's a validation error related to the StuffDocumentsChain and its input variables. The error message details that the variable name summaries was not found in the llm_chain input_variables. You might need to check the input variables and ensure that summaries is properly defined or used in your code.

KameniAlexNea commented 9 months ago

@billmetangmo Done on our side (@Joyce-Tchamdjou )

billmetangmo commented 9 months ago

One output key expected, got dict_keys(['result', 'source_documents'])