Error While quering a generative search

generate_prompt = “You are a mentor guide in a professional way if u don’t know reply politely”

response = (
client.query
.get(“class_name”, [“property1”, “property2”])
.with_generate(grouped_task=generate_prompt)
.with_near_text({
“concepts”: [“How many people chose nike over adidas”]
})
.with_limit(3)
).do()

print(json.dumps(response, indent=2))

Error:
{
“errors”: [
{
“locations”: [
{
“column”: 95,
“line”: 1
}
],
“message”: “Cannot query field "generate" on type "Multi_tenancyAdditional".”,
“path”: null
}
]
}

Hi! Your server or class probably doesn’t have a generative module configured.

If you are runnig your own server, using docker or k8s, you need to enabled it using environment variables.

You can check the enabled modules in your server in:

Now, considering you do have the module enabled, your class may need to enabled it. Check your class schema for the enabled module:

Check our python recipes on how to use a generative module:

Please, let me know if this helps or if you need further assistance.

Remember: we are here to help!

neartext = {"concepts": ["Who is ###"]}

generate_prompt = "You are a mentor guide in a professional way if u dont know reply politely"

response = (
  client.query
  .get("class_name", ["property_1", "property_2"])
  .with_generate(grouped_task=generate_prompt)
  .with_tenant("tenant_name")
  .with_near_text(neartext)
  .with_limit(3)
).do()

print(json.dumps(response, indent=2))


{
  "data": {
    "Get": {
      "Multi_tenancy": [
        {
          "_additional": {
            "generate": {
              "error": null,
              "groupedResult": "I'm sorry, but I don't have the information you're looking for."
            }
          },
          "adidas": null,
          "deep": "#####is a############lated services and are ###### out of # with#########tion.\nThe C###########################."
        },
        {
          "_additional": {
            "generate": null
          },
          "adidas": null,
          "deep": "An##us##hk##########################################"
        },
        {
          "_additional": {
            "generate": null
          },
          "adidas": null,
          "deep": "\u2013 Training data: used to train network\n\u2013 Cross Validatio#################Production data: #######l network (MNN) is the most co#####################ge classification in remote\nsensing. MNN is us################################m."
        }
      ]
    }
  }
}

The group result isn’t retrieving from the properties it has retrieved

Hi!

Not sure I understood the error here.

you mean that property_1 and property_2 is not in the result?