Skip to content

[bug] input_type is not passed when text embedding #241

@utsumi-fj

Description

@utsumi-fj

Description

The variable data.input_type, which stores either EmbeddingInputType.DOCUMENT or EmbeddingInputType.QUERY, is not passed when executing text embedding.

data.input_type should be passed to model_instance.invoke located here:
https://github.com/langgenius/dify-plugin-sdks/blob/0.6.1/python/dify_plugin/core/plugin_executor.py#L213

Background

When implementing a custom _invoke method in the following plugin:
https://github.com/langgenius/dify-official-plugins/blob/main/models/openai_api_compatible/models/text_embedding/text_embedding.py

I attempted to check the value of input_type inside _invoke. However, input_type was always EmbeddingInputType.DOCUMENT, even when the request was actually a query.

This suggests that the correct input_type value is not being passed through to _invoke.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions