Hi!
I have a problem, which I can’t seem to figure out.
I created a schema with the following config:
{
"class": "article",
"descripition": "Article collection",
"properties": [
{
"indexFilterable": false,
"indexSearchable": false,
"name": "dirId",
"dataType": [
"string"
],
"moduleConfig": {
"text2vec-openai": {
"skip": true
},
"qna-openai": {
"skip": true
},
"generative-openai": {
"skip": true
}
}
},
{
"name": "title",
"dataType": [
"text"
],
"description": "Article Title",
"moduleConfig": {
"text2vec-openai": {
"model": "text-embedding-3-large",
"dimensions": 1024
},
"qna-openai": {
"model": "gpt-3.5-turbo-instruct"
}
}
},
{
"name": "content",
"dataType": [
"text"
],
"description": "Article Content",
"indexFilterable": true,
"indexSearchable": true,
"moduleConfig": {
"text2vec-openai": {
"model": "text-embedding-3-large",
"dimensions": 1024
},
"qna-openai": {
"model": "gpt-3.5-turbo-instruct"
}
}
},
{
"name": "url",
"dataType": [
"string"
],
"description": "Article URL",
"indexFilterable": true,
"indexSearchable": false,
"moduleConfig": {
"text2vec-openai": {
"skip": true
},
"qna-openai": {
"skip": true
},
"generative-openai": {
"skip": true
}
}
},
{
"name": "language",
"dataType": [
"string"
],
"description": "Article Language"
}
],
"moduleConfig": {
"generative-openai": {
"model": "gpt-4-1106-preview",
"maxTokensProperty": 4096
},
"text2vec-openai": {
"model": "text-embedding-3-large",
"dimensions": 1024
},
"qna-openai": {
"model": "gpt-3.5-turbo-instruct"
}
}
}
During Import of articles I made sure I chunk the articles to stay within the token limit for the vectorization of 8000 token as estimated by the tiktoken npm package with the WASM bindings.
I imported 100 articles as a test which came out to 101 chunks in total. Meaning only 1 article exceeded the 8k chunk border.
Now If I try to run a simple groupedTask test to generate some responses across multiple articles I run into a token limit. This is the error I receive:
WeaviateQueryError: Query call with protocol gRPC failed with message: /weaviate.v1.Weaviate/Search UNKNOWN: connection to: OpenAI API failed with status: 400 error: max_tokens is too large: 10189. This model supports at most 4096 completion tokens, whereas you provided 10189.
This is the code I used to test the generative Search function:
const collection = client.collections.get('Article');
const result = await collection.generate.nearText(search, {
groupedTask: prompt,
groupedProperties: ['title', 'content'],
}, {
autoLimit: 2,
});
I tried using limit vs autoLimit, tried setting it to 1 instead of 2 (altough I should be able to use somewhere around 16 articles as input, right? (128k input window for gpt-4-turbo)
The error suggests to me, that I need to set the max_tokens somewhere else but I tried to do it during the creation of my class.
Could anybody point me in the right direction?
Thanks!
Steve