Skip to content

add units for ollama#87

Merged
JaredforReal merged 2 commits intomainfrom
test/ollama
Feb 9, 2026
Merged

add units for ollama#87
JaredforReal merged 2 commits intomainfrom
test/ollama

Conversation

@JaredforReal
Copy link
Collaborator

Contribution Guide

We welcome your contributions to this repository. To ensure elegant code style and better code quality, we have prepared
the following contribution guidelines.

What We Accept

  • This PR fixes a typo or improves the documentation (if this is the case, you may skip the other checks).
  • This PR fixes a specific issue — please reference the issue number in the PR description. Make sure your code strictly
    follows the coding standards below.
  • This PR introduces a new feature — please clearly explain the necessity and implementation of the feature. Make sure
    your code strictly follows the coding standards below.

Code Style Guide

Good code style is an art. We have prepared a pre-commit hook to enforce consistent code
formatting across the project. You can clean up your code following the steps below:

pre-commit run --all-files

If your code complies with the standards, you should not see any errors.

Naming Conventions

  • Please use English for naming; do not use Pinyin or other languages. All comments should also be in English.
  • Follow PEP8 naming conventions strictly, and use underscores to separate words. Avoid meaningless names such as
    a, b, c.

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Copilot AI review requested due to automatic review settings February 9, 2026 05:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds unit test coverage for the existing Ollama /api/generate integration path in OCRClient, ensuring request conversion and response parsing behave correctly alongside the default OpenAI-compatible mode.

Changes:

  • Add unit tests validating OCRApiConfig.api_mode defaults and OCRClient mode selection.
  • Add unit tests for _convert_to_ollama_generate() covering prompt/image extraction and option mapping.
  • Add unit tests for OCRClient.process() and OCRClient.connect() behavior in both ollama_generate and openai modes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: JaredforReal <w13431838023@gmail.com>
@JaredforReal JaredforReal merged commit ca26d02 into main Feb 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant