Skip to content

[PY] genkit-plugin-ollama missing objects ModelDefinition, EmbeddingModelDefinition #3697

@axisrow

Description

@axisrow

Describe the bug
Installing genkit-plugin-ollama (version 0.4.0) as instructed by the official documentation leads to ImportError when attempting to use EmbeddingModelDefinition or ModelDefinition from the plugin.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the official instructions from [Genkit documentation](https://genkit.dev/docs/integrations/ollama/?lang=python).
  2. Install genkit-plugin-ollama using pip3 install genkit-plugin-ollama.
  3. Attempt to import EmbeddingModelDefinition or ModelDefinition from genkit.plugins.ollama in a Python script.

Code samples:

from genkit.plugins.ollama import EmbeddingModelDefinition, ModelDefinition

Error message:

ImportError: cannot import name 'EmbeddingModelDefinition' (or 'ModelDefinition') from 'genkit.plugins.ollama'
(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/genkit/plugins/ollama/__init__.py)

Expected behavior
EmbeddingModelDefinition and ModelDefinition should be importable from genkit.plugins.ollama as indicated by the official documentation.

Runtime (please complete the following information):

  • OS: MacOS
  • Genkit Version: genkit-plugin-ollama==0.4.0

Python version

  • python3 --version: Python 3.11.9

Additional context
The instructions were taken directly from the official Genkit documentation: https://genkit.dev/docs/integrations/ollama/?lang=python.
However, the imports for EmbeddingModelDefinition and ModelDefinition fail, preventing proper configuration of Ollama models within Genkit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpythonPython

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions