Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Dec 13, 2024
1 parent 6eb88a1 commit dae8e4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
28 changes: 8 additions & 20 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,16 @@ def loader_registry() -> ResourceLoaderRegistry:
def test_config() -> Config:
"""Create test configuration with sample data."""
prompt_msg = PromptMessage(role="user", content="Test message")
text = TextResource(content="test content", description="Test resource")
path = "llmling.testing.tools.example_tool"
desc = "Example tool for testing"
cfg = ToolConfig(import_path=path, name="example", description=desc)
prompt = StaticPrompt(name="test-prompt", description="Test", messages=[prompt_msg])
return Config(
version="1.0.0",
global_settings=GlobalSettings(),
resources={
"test-resource": TextResource(
content="test content", description="Test resource"
),
},
tools={
"example": ToolConfig(
import_path="llmling.testing.tools.example_tool",
name="example",
description="Example tool for testing",
),
},
prompts={
"test-prompt": StaticPrompt(
name="test-prompt",
description="Test prompt",
messages=[prompt_msg],
),
},
resources={"test-resource": text},
tools={"example": cfg},
prompts={"test-prompt": prompt},
)


Expand Down
13 changes: 4 additions & 9 deletions tests/resources/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,10 @@ async def test_path_loader_directory_with_processors(
(tmp_path / "file2.txt").write_text("test2")

# Set up processor
processor_registry.register(
"reverse",
ProcessorConfig(import_path="llmling.testing.processors.reverse_text"),
)

resource = PathResource(
path=str(tmp_path),
processors=[ProcessingStep(name="reverse")],
)
cfg = ProcessorConfig(import_path="llmling.testing.processors.reverse_text")
processor_registry.register("reverse", cfg)
procs = [ProcessingStep(name="reverse")]
resource = PathResource(path=str(tmp_path), processors=procs)
loader = PathResourceLoader(LoaderContext(resource=resource, name="test"))
files = [
result async for result in loader.load(processor_registry=processor_registry)
Expand Down

0 comments on commit dae8e4f

Please sign in to comment.