Closed lusabo closed 5 days ago
Hi you will need to override the default embedding that uses openai. Please see
https://docs.crewai.com/tools/JSONSearchTool/#usage-examples
@gadgethome why is there a need to override when I want to use ada from Openai? The key works as intended when only a language model is required but gives a key error when embeddings are used.
@gadgethome why is there a need to override when I want to use ada from Openai? The key works as intended when only a language model is required but gives a key error when embeddings are used.
What does your embedding conf look like? If there is anything wrong with it crew will default to gpt4
As my crew is using Llama3, I thought the tool would use what is defined in the crew. I tried to override like below without success, maybe because I don't have the Google API configured. I will do it in a moment.
json_tool = JSONSearchTool(
json_path='/content/hotels.json', #Is it correct?
config={
"llm": {
"provider": "ollama",
"config": {
"model": "llama3"
},
},
"embedder": {
"provider": "google",
"config": {
"model": "models/embedding-001", #what add here?
"task_type": "retrieval_document" #where can I see task_type?
},
},
}
)
Whether or not I configure the API key created in AIStudio, I have the error below.
os.environ["API_KEY"] = "my_key_comes_here"
ERROR:grpc._plugin_wrapping:AuthMetadataPluginCallback "<google.auth.transport.grpc.AuthMetadataPlugin object at 0x791ecbfd5cc0>" raised exception! Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/google/auth/compute_engine/credentials.py", line 128, in refresh self._retrieve_info(request) File "/usr/local/lib/python3.10/dist-packages/google/auth/compute_engine/credentials.py", line 101, in _retrieve_info info = _metadata.get_service_account_info( File "/usr/local/lib/python3.10/dist-packages/google/auth/compute_engine/_metadata.py", line 323, in get_service_account_info return get(request, path, params={"recursive": "true"}) File "/usr/local/lib/python3.10/dist-packages/google/auth/compute_engine/_metadata.py", line 248, in get raise exceptions.TransportError( google.auth.exceptions.TransportError: ("Failed to retrieve http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/?recursive=true from the Google Compute Engine metadata service. Status: 404 Response:\nb''", <google.auth.transport.requests._Response object at 0x791ecae217e0>)
The above exception was the direct cause of the following exception:
I solved the connection problem with::
import google.generativeai as genai
...
os.environ["API_KEY"] = "The key"
genai.configure(api_key=os.environ['API_KEY'])
I solved the connection problem with::
import google.generativeai as genai ... os.environ["API_KEY"] = "The key" genai.configure(api_key=os.environ['API_KEY'])
I have used this to authenticate Gemini models but this still doesn't work with crew. Tbh I don't understand how this could be a key error.
I think this is also related to the known issue that RAG out of the box only works with openai, and there is an embedchain chromate version conflict in v0.30.11 Hoping for next version to fix this, there are some workarounds mentioned here and on the Discord server.
I think this is also related to the known issue that RAG out of the box only works with openai, and there is an embedchain chromate version conflict in v0.30.11 Hoping for next version to fix this, there are some workarounds mentioned here and on the Discord server.
Any fix for RAG using Gemini?
HI all,
Suddenly my example stopped working and now I receive the error:
ModuleNotFoundError: No module named 'ollama'
I put details on Discord: https://discord.com/channels/1192246288507474000/1252690687804051529
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
I'm running it on Google Colab, I created a JSON file and uploaded it.
The code is quite simple:
json_tool = JSONSearchTool(json_path='/content/hotels.json')
When I am running the code I getting the error:
KeyError: 'OPENAI_API_KEY'
Wasn't it supposed to only fetch the information within JSON?