I have created class with following properties. And ingestion around 13K object.
# ===== define collection =====
class_obj = {
"class": "ProductCatalogNumeric",
"vectorizer": "text2vec-openai", # If set to "none" you must always provide vectors yourself. Could be any other "text2vec-*" also.
"moduleConfig": {
"text2vec-openai": {},
"generative-openai": {} # Ensure the `generative-openai` module is used for generative queries
},
"properties": [
{
"name": "title",
"dataType": ["text"],
"description": "Name of product that we are selling in our marketplace"
},
{
"name": "jpin",
"dataType": ["text"],
"description": "Jpin represent unique identifier for every product"
},
{
"name": "price",
"dataType": ["number"],
"description": "The selling price of the product"
},
{
"name": "margin",
"dataType": ["number"],
"description": "Percenatge Margin we earn after saling of the product"
},
],
}
client.schema.create_class(class_obj)
But when i am asking below question , its giving data/field not present ?
this is my question:
response = (
client.query
.get("ProductCatalogNumeric", ['title','jpin','price','margin'])
.with_near_text({"concepts": ["basmati rice"]})
.with_generate(grouped_task="Tell me average price of all basmati rice products. And show calculation ? ")
.with_limit(100)
.do()
)
print(json.dumps(response, indent=4))
And this is open ai llm response
{
"data": {
"Get": {
"ProductCatalogNumeric": [
{
"_additional": {
"generate": {
"error": null,
"groupedResult": "To calculate the average price of all basmati rice products, we need to first gather the prices of all the products listed. Since the prices are not provided in the given data, we cannot calculate the average price."
}
},
"jpin": "JPIN-1304444084",
"margin": 0.064957,
"price": 121.03000000000002,
"title": "Daawat Devaaya Basmati Rice, 1Kg Pack"
},
{
"_additional": {
"generate": null
},
"jpin": "JPIN-1304511345",
"margin": 0.0241038235,
"price": 2580,
"title": "Gauri Rozana Steamed Basmati Rice, 30Kg Bag"
},
{
"_additional": {
"generate": null
},
"jpin": "JPIN-1304351614",
"margin": 0.0638388,
"price": 113.20000000000002,
"title": "Daawat Heritage Platinum Basmati Rice, Classic, 1Kg Pack"
},
{
"_additional": {
"generate": null
},
"jpin": "JPIN-1304472302",
"margin": 0.063287,
"price": 182.56,
"title": "Daawat Traditional Basmati Rice, 1Kg Pack"
},
}