Comments (1)
Hey @devorem! Great to see you back around here 😊 Let's dive into what's been bugging you.
Based on the error message you're receiving, it seems that the brain_id
field is indeed required for the Question handler API call. This field is used to identify the specific "brain" (or knowledge base) that the question should be routed to for processing.
The brain_id
should be added in the request as part of the JSON payload. For example, if there's an endpoint that expects a request body, you would include 'brain_id' like so:
{
"model": "some_model",
"brain_id": "specific_brain_id",
"chat_id": "some_chat_id",
...
}
The exact structure of the API request that the APIBrainQA
class expects is defined within the get_api_call_response_as_text
method. This method outlines how the API request is constructed and sent, including the method type (GET, DELETE, POST, PUT, PATCH), the API URL, parameters, search parameters, and headers (which may include secrets).
Here is the relevant code snippet:
def get_api_call_response_as_text(
self, method, api_url, params, search_params, secrets
) -> str:
headers = {}
api_url_with_search_params = api_url
if search_params:
api_url_with_search_params += "?"
for search_param in search_params:
api_url_with_search_params += (
f"{search_param}={search_params[search_param]}&"
)
for secret in secrets:
headers[secret] = secrets[secret]
try:
if method in ["GET", "DELETE"]:
response = requests.request(
method,
url=api_url_with_search_params,
params=params or None,
headers=headers or None,
)
elif method in ["POST", "PUT", "PATCH"]:
response = requests.request(
method,
url=api_url_with_search_params,
json=params or None,
headers=headers or None,
)
else:
raise ValueError(f"Invalid method: {method}")
return response.text
This method is where the API request structure is defined and handled within the APIBrainQA
class. You can find this in the backend/modules/brain/api_brain_qa.py file.
I hope this helps! If you have any other questions, feel free to ask.
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from quivr.
Related Issues (20)
- [Bug]: Unable to chat with newly created brain HOT 4
- spaces removed whilst typing a question[Bug]: HOT 2
- [Bug]: Unable to perform a search with ollama/mistral HOT 1
- [Bug]: I got error on CMD Windows after docker compose up HOT 2
- [Feature]: Ethics & Transparency HOT 1
- [Bug]: I did not run out of space but getting no space left error HOT 1
- [Bug]: Unrelated results being passed to LLM on query HOT 5
- [Feature]: Is it possible to change the name of the ai models? HOT 2
- [Bug]: backend HOT 1
- [Bug]: Giving Mix and Fall Responses HOT 4
- [Bug]: local supabase db reset ,after create a new user,Failed to create user: An error has occurred: Failed to fetch HOT 7
- [Bug]: Can't add new Brain -- UI doesn't display brain choice HOT 2
- [Feature]: On-Demand Ollama Service Initialization HOT 1
- [Bug]: Knowledge not being returned from brain in latest release HOT 1
- [Bug]: No "create brain" options when running on WSL HOT 5
- [Bug]: Error occurred while fetching your chats HOT 1
- [Feature]: Support of bibliography ".bib" and LaTeX ".tex" HOT 5
- [Bug]: cannot create the brain HOT 3
- Suggestion Withdrawn HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quivr.