Skip to content

certainty parameter not found in The qna-openai module #50

@Chuck1sn

Description

@Chuck1sn

https://weaviate.io/developers/weaviate/modules/reader-generator-modules/qna-openai

The qna-openai module tries to find an answer in the data objects of the specified class. If an answer is found within the given certainty range, it will be returned in the GraphQL _additional { answer { ... } } field. There will be a maximum of 1 answer returned, if this is above the optionally set certainty. The answer with the highest certainty (confidence level) will be returned.

  1. How can I use the certainty parameter to filter out irrelevant questions when using the question and answer module with OpenAI?
  2. And if certainty parameter is supported, is certainty:0.75 be properly when I want to return empty when users ask questions that are unrelated to the extracted article content?

Here is my code block

client.graphql
		.get()
		.withClassName(schema)
		.withAsk({
			question: question
		})
		.withFields(
			'content _additional { answer { hasAnswer property result startPosition endPosition } }'
		)
		.withLimit(1)
		.do()
		.then((res: any) => {
			console.log(JSON.stringify(res, null, 2))
			return res.data.Get[schema][0]._additional.answer.result
		})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions