chore: import upstream snapshot with attribution
Ruff / Ruff (push) Has been cancelled
Test / Core Tests (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.10) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.11) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.12) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.13) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.9) (push) Has been cancelled
Test / Full Coverage (Python 3.11) (push) Has been cancelled
Test / Core Provider Tests (OpenAI) (push) Has been cancelled
Test / Core Provider Tests (Anthropic) (push) Has been cancelled
Test / Core Provider Tests (Google) (push) Has been cancelled
Test / Core Provider Tests (Other) (push) Has been cancelled
Test / Anthropic Tests (push) Has been cancelled
Test / Gemini Tests (push) Has been cancelled
Test / Google GenAI Tests (push) Has been cancelled
Test / Vertex AI Tests (push) Has been cancelled
Test / OpenAI Tests (push) Has been cancelled
Test / Writer Tests (push) Has been cancelled
Test / Auto Client Tests (push) Has been cancelled
ty / type-check (push) Has been cancelled
Ruff / Ruff (push) Has been cancelled
Test / Core Tests (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.10) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.11) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.12) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.13) (push) Has been cancelled
Test / Offline Coverage Tests (Python 3.9) (push) Has been cancelled
Test / Full Coverage (Python 3.11) (push) Has been cancelled
Test / Core Provider Tests (OpenAI) (push) Has been cancelled
Test / Core Provider Tests (Anthropic) (push) Has been cancelled
Test / Core Provider Tests (Google) (push) Has been cancelled
Test / Core Provider Tests (Other) (push) Has been cancelled
Test / Anthropic Tests (push) Has been cancelled
Test / Gemini Tests (push) Has been cancelled
Test / Google GenAI Tests (push) Has been cancelled
Test / Vertex AI Tests (push) Has been cancelled
Test / OpenAI Tests (push) Has been cancelled
Test / Writer Tests (push) Has been cancelled
Test / Auto Client Tests (push) Has been cancelled
ty / type-check (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
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
|
||||
Reference in New Issue
Block a user