Skip to content

Commit

Permalink
ollama: generate api docs (#332)
Browse files Browse the repository at this point in the history
* ollama: generate api docs

* Update .github/workflows/ollama.yml

Co-authored-by: Silvano Cerza <[email protected]>

---------

Co-authored-by: Silvano Cerza <[email protected]>
  • Loading branch information
dfokina and silvanocerza authored Feb 2, 2024
1 parent 26680ca commit f7678e1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ollama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ jobs:
- name: Pull the LLM in the Ollama service
run: docker exec ollama ollama pull ${{ env.LLM_FOR_TESTS }}

- name: Generate docs
working-directory: integrations/ollama
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
working-directory: integrations/ollama
run: hatch run cov
29 changes: 29 additions & 0 deletions integrations/ollama/pydoc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
loaders:
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
search_path: [../src]
modules: [
"haystack_integrations.components.generators.ollama.generator",
"haystack_integrations.components.generators.ollama.chat.chat_generator"
]
ignore_when_discovered: ["__init__"]
processors:
- type: filter
expression:
documented_only: true
do_not_filter_modules: false
skip_empty_modules: true
- type: smart
- type: crossref
renderer:
type: haystack_pydoc_tools.renderers.ReadmePreviewRenderer
excerpt: Ollama integration for Haystack
category_slug: haystack-integrations
title: Ollama
slug: integrations-ollama
order: 120
markdown:
descriptive_class_title: false
descriptive_module_title: true
add_method_class_prefix: true
add_member_class_prefix: false
filename: _readme_ollama.md
4 changes: 4 additions & 0 deletions integrations/ollama/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ git_describe_command = 'git describe --tags --match="integrations/ollama-v[0-9]*
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
Expand All @@ -60,6 +61,9 @@ cov = [
"test-cov",
"cov-report",
]
docs = [
"pydoc-markdown pydoc/config.yml"
]

[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
Expand Down

0 comments on commit f7678e1

Please sign in to comment.