Arvo
12/30/2024, 2:38 AMconst response = await vapiClient.assistants.create({
...
model: {
provider: "openai",
model: "gpt-4o-mini",
temperature: 0.7,
messages: [{ role: "system", content: instructions }],
//knowledgeBaseId: "my-kb-id" ERROR HERE
//knowledgeBase: {knowledgeBaseId: "my-kb-id"} ALSO ERROR HERE
},
...
});
The specific error I get is:
Object literal may only specify known properties, but 'knowledgeBaseId' does not exist in type 'OpenAiModel'. Did you mean to write 'knowledgeBase'?
I am able to create assistants fine without it. But I would like to create assistants with access to my knowledge base too. I already have a knowledge base setup that is working. The knowledge base id I use is correct.
Am I missing something?Vapi
12/30/2024, 2:40 AMVapi
12/30/2024, 2:40 AMvapiClient.assistants.create
method. According to the error message, the OpenAiModel
type does not recognize knowledgeBaseId
as a valid property. Instead, it suggests that you might want to use knowledgeBase
.
Since the error message suggests using knowledgeBase
, you should try passing the knowledgeBaseId
within a knowledgeBase
object. Here's how you can modify your code:
javascript
const response = await vapiClient.assistants.create({
...
model: {
provider: "openai",
model: "gpt-4o-mini",
temperature: 0.7,
messages: [{ role: "system", content: instructions }],
knowledgeBase: { id: "my-kb-id" } // Adjusted property structure
},
...
});
Make sure that the knowledgeBase
object contains an id
property with the value of your knowledge base ID. If this structure does not work, please refer to the SDK documentation or ask support for more info on this.Vapi
12/30/2024, 2:40 AMArvo
12/30/2024, 4:47 AMconst openAiModel: OpenAIModel = {
provider: "openai",
model: "gpt-4o",
temperature: 0.7,
messages: [{ role: "system", content: instructions }],
knowledgeBaseId: "my-kb-id"
}
It does not work either. Looking at the github for typescript sdk shows this should be possible. Not sure why it doesn't recognize knowledgeBaseIdArvo
12/30/2024, 4:49 AMVapi
12/30/2024, 4:49 AMknowledgeBaseId
should be a valid property, but you're still encountering errors, here are a few steps you can take:
1. **Check SDK Version**: Ensure that you are using the latest version of the @vapi-ai/server-sdk
. If not, consider updating to the latest version where the knowledgeBaseId
might be supported.
2. **Review Documentation**: Double-check the official SDK documentation for any updates or changes in the way the knowledgeBaseId
should be specified.
3. **TypeScript Definitions**: Look into the node_modules/@vapi-ai/server-sdk
directory, specifically the TypeScript definition files (.d.ts
), to confirm that knowledgeBaseId
is indeed a valid property within the OpenAIModel
interface.
4. **Contact Support**: Since the "Ask for help" button interaction is failing, you might want to reach out to the support team directly through their provided contact methods (e.g., email, support ticket system).
5. **GitHub Issues**: If you believe this to be a bug or an issue with the SDK, consider opening an issue on the GitHub repository where the SDK is maintained. Provide detailed information about the problem, including the version of the SDK you're using and the exact error message.
In the meantime, if you have any other questions or need further assistance with a different aspect of the VAPI, feel free to ask.Arvo
12/30/2024, 5:21 AMAurora
01/01/2025, 1:13 PMAurora
01/01/2025, 1:15 PMAurora
01/01/2025, 1:15 PMShubham Bajaj
01/02/2025, 2:01 PM