97e91a83f3
Ruff / Ruff (push) Waiting to run
Test / Core Tests (push) Waiting to run
Test / Offline Coverage Tests (Python 3.10) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.11) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.12) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.13) (push) Waiting to run
Test / Offline Coverage Tests (Python 3.9) (push) Waiting to run
Test / Full Coverage (Python 3.11) (push) Waiting to run
Test / Core Provider Tests (OpenAI) (push) Blocked by required conditions
Test / Core Provider Tests (Anthropic) (push) Blocked by required conditions
Test / Core Provider Tests (Google) (push) Blocked by required conditions
Test / Core Provider Tests (Other) (push) Blocked by required conditions
Test / Anthropic Tests (push) Blocked by required conditions
Test / Gemini Tests (push) Blocked by required conditions
Test / Google GenAI Tests (push) Blocked by required conditions
Test / Vertex AI Tests (push) Blocked by required conditions
Test / OpenAI Tests (push) Blocked by required conditions
Test / Writer Tests (push) Blocked by required conditions
Test / Auto Client Tests (push) Blocked by required conditions
ty / type-check (push) Waiting to run
63 lines
1.3 KiB
Python
63 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
import glob
|
|
import os
|
|
from collections.abc import Iterable
|
|
|
|
from pytest_examples import find_examples
|
|
|
|
EXCLUDED = {
|
|
"ollama.md",
|
|
"watsonx.md",
|
|
"local_classification.md",
|
|
}
|
|
|
|
BATCH = {
|
|
"batch_classification_langsmith.md",
|
|
"batch_in_memory.md",
|
|
"batch_job_oai.md",
|
|
}
|
|
|
|
MULTIMODAL = {
|
|
"audio_extraction.md",
|
|
"extract_slides.md",
|
|
"extracting_receipts.md",
|
|
"image_to_ad_copy.md",
|
|
"multi_modal_gemini.md",
|
|
"tables_from_vision.md",
|
|
"youtube_clips.md",
|
|
}
|
|
|
|
PROVIDERS = {
|
|
"groq.md",
|
|
"mistral.md",
|
|
"open_source.md",
|
|
}
|
|
|
|
INTEGRATIONS = {
|
|
"search.md",
|
|
"tracing_with_langfuse.md",
|
|
}
|
|
|
|
|
|
def example_paths(names: Iterable[str]) -> list[str]:
|
|
return [os.path.join("docs", "examples", name) for name in names]
|
|
|
|
|
|
def all_example_files() -> list[str]:
|
|
return sorted(glob.glob("docs/examples/*.md"))
|
|
|
|
|
|
def core_example_files() -> list[str]:
|
|
excluded = EXCLUDED | BATCH | MULTIMODAL | PROVIDERS | INTEGRATIONS
|
|
return [
|
|
path for path in all_example_files() if os.path.basename(path) not in excluded
|
|
]
|
|
|
|
|
|
def collect_examples(files: Iterable[str]):
|
|
examples = []
|
|
for markdown_file in files:
|
|
examples.extend(find_examples(markdown_file))
|
|
return examples
|