unable to add knowledgebase when creating ai agent...
# support
v
message has been deleted
@Kavish I'm here to help! To add a knowledge base when creating an AI agent through the API, you'll typically need to specify the knowledge base parameters within your API request. This usually involves providing the
knowledgeBase
object with the appropriate
provider
,
topK
, and
fileIds
values. If you're encountering issues, could you please provide me with more details about the error you're receiving or the specific part of the process that's causing trouble? This will help me assist you more effectively.
You can continue this conversation by mentioning me in the message.
@Kavish It looks like you're trying to create an AI agent with a knowledge base using a cURL request. Your JSON payload seems mostly correct, but there are a couple of potential issues that might be causing problems: 1. The
knowledgeBase
object within the
model
object seems to have an incorrect structure. Typically, a
knowledgeBase
object wouldn't contain a
server
object with a
url
field. Instead, it might require an
id
or other identifying information directly related to the knowledge base. 2. The
knowledgeBaseId
field is outside of the
knowledgeBase
object, which might be incorrect depending on the API's expected schema. Usually, the
knowledgeBaseId
would be part of the
knowledgeBase
object. Here's a revised version of your JSON payload that might work, assuming
knowledgeBaseId
is the correct field and that it should be inside the
knowledgeBase
object:
Copy code
json
{
  "transcriber": {
    "provider": "deepgram",
    "model": "nova-2",
    "keywords": [],
    "language": "en"
  },
  "model": {
    "provider": "openai",
    "model": "gpt-3.5-turbo",
    "toolIds": [],
    "tools": [],
    "knowledgeBase": {
      "knowledgeBaseId": "ca6c4605-203d-4bc0-a18b-cad7f277956c"
    }
  }
}
Please adjust your cURL request with the corrected JSON payload and try again. If you're still encountering issues, it might be helpful to check the API documentation for the exact structure required for creating an AI agent with a knowledge base, or reach out to the API support team for further assistance.
k
what if i want to add totally new file to ai agent when creating ai agent which is not created yet @Vapi
v
@Kavish If you want to add a totally new file to an AI agent during the creation process, and the file has not been created or uploaded yet, you will typically need to follow these steps: 1. **Upload the File**: Before you can reference a file in your AI agent creation request, you need to upload the file to the service's storage or a location that the API can access. This step often involves a separate API call to an endpoint designed for file uploads. 2. **Obtain File ID or Reference**: After uploading the file, the API should provide you with a file ID or some form of reference to the uploaded file. 3. **Create the AI Agent**: With the file ID or reference in hand, you can now include this in your AI agent creation request. The exact field name and location within the request body will depend on the API's specification. Since you're working with the VAPI, you'll need to consult the specific documentation for the correct endpoints and procedures for uploading files and including them in your AI agent creation request. If the VAPI allows for the creation of a knowledge base and the uploading of files in a single operation, you would include the necessary information about the file in your creation request. However, if the API requires files to be uploaded beforehand, you would need to complete that step before making the AI agent creation request. If you need further assistance with the exact API calls or parameters, please consult the VAPI documentation or reach out to their support team for detailed guidance. If the VAPI provides a function for this operation, please provide the necessary parameters, and I can assist you with calling that function.
k
@Vapi solve this quick
9 Views