langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
35.59k stars 4.8k forks source link

Knowledge:Retrieval Testing->5 validation errors for ParsingModel[InlineResponse20015] #5640

Open luckylhb90 opened 3 days ago

luckylhb90 commented 3 days ago

Self Checks

Dify version

0.6.11

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1.Knowledge:Retrieval Testing:

image

2.My configuration:

image

3.Exception: 5 validation errors for ParsingModel[InlineResponse20015] (for parse_as_type) obj.result.0.order_value Extra inputs are not permitted [type=extra_forbidden, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden obj.result.1.order_value Extra inputs are not permitted [type=extra_forbidden, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden obj.result.2.order_value Extra inputs are not permitted [type=extra_forbidden, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden obj.result.3.order_value Extra inputs are not permitted [type=extra_forbidden, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden obj.result.4.order_value Extra inputs are not permitted [type=extra_forbidden, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 3 days ago

@luckylhb90 Hello there! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's work together to resolve any issues you may have.

To resolve the validation errors related to ParsingModel[InlineResponse20015] during retrieval testing in your self-hosted Dify version 0.6.11 setup, you need to ensure that a rerank model is selected. The provided code snippet includes a function handleSave that checks if a rerank model is selected and shows an error message if it is not.

Here is the relevant part of the code:

const handleSave = () => {
    if (
      !isReRankModelSelected({
        rerankDefaultModel,
        isRerankDefaultModelVaild: !!isRerankDefaultModelVaild,
        rerankModelList,
        retrievalConfig,
        indexMethod,
      })
    ) {
      Toast.notify({ type: 'error', message: t('appDebug.datasetConfig.rerankModelRequired') })
      return
    }
    onSave(ensureRerankModelSelected({
      rerankDefaultModel: rerankDefaultModel!,
      retrievalConfig,
      indexMethod,
    }))
  }

To resolve the validation errors, make sure that the retrievalConfig includes a valid rerank model. The isReRankModelSelected function checks if a rerank model is selected, and if not, it shows an error message. The ensureRerankModelSelected function ensures that the selected rerank model is saved.

Ensure that your retrievalConfig is correctly set up with a valid rerank model before calling the handleSave function [1].

Additionally, the ParsingModel class handles extra fields by raising a validation error if any fields are present that are not defined in the schema. This is evident from the validate_config method in the CloudServiceModeration class, which checks for required fields and validates the configuration against the schema. The common causes of the extra_forbidden validation error are the presence of fields in the configuration that are not defined in the schema.json or incorrect/additional fields being passed in the configuration that do not match the expected schema [2].

To continue talking to Dosu, mention @dosu.

luckylhb90 commented 3 days ago

It's not solved yet. Why is it Closed?

luckylhb90 commented 2 days ago
image

I deployed the latest code, still this error... I also configured the rerank model, but it still doesn't work. Vector retrieval.

laipz8200 commented 2 days ago

Seems it's not the same error, let's check it.