Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace metadata w meta in tests/examples #6612

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/pipelines/test_rag_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_bm25_rag_pipeline(tmp_path):
rag_pipeline.connect("retriever", "prompt_builder.documents")
rag_pipeline.connect("prompt_builder", "llm")
rag_pipeline.connect("llm.replies", "answer_builder.replies")
rag_pipeline.connect("llm.metadata", "answer_builder.metadata")
rag_pipeline.connect("llm.meta", "answer_builder.meta")
rag_pipeline.connect("retriever", "answer_builder.documents")

# Draw the pipeline
Expand Down Expand Up @@ -108,7 +108,7 @@ def test_embedding_retrieval_rag_pipeline(tmp_path):
rag_pipeline.connect("retriever", "prompt_builder.documents")
rag_pipeline.connect("prompt_builder", "llm")
rag_pipeline.connect("llm.replies", "answer_builder.replies")
rag_pipeline.connect("llm.metadata", "answer_builder.metadata")
rag_pipeline.connect("llm.meta", "answer_builder.meta")
rag_pipeline.connect("retriever", "answer_builder.documents")

# Draw the pipeline
Expand Down
2 changes: 1 addition & 1 deletion examples/pipelines/rag_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
rag_pipeline.connect("retriever", "prompt_builder.documents")
rag_pipeline.connect("prompt_builder", "llm")
rag_pipeline.connect("llm.replies", "answer_builder.replies")
rag_pipeline.connect("llm.metadata", "answer_builder.metadata")
rag_pipeline.connect("llm.meta", "answer_builder.meta")
rag_pipeline.connect("retriever", "answer_builder.documents")

# Ask a question on the data you just added.
Expand Down
8 changes: 4 additions & 4 deletions test/components/generators/chat/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ def test_live_run(self):
assert len(results["replies"]) == 1
message: ChatMessage = results["replies"][0]
assert "Paris" in message.content
assert "gpt-3.5" in message.metadata["model"]
assert message.metadata["finish_reason"] == "stop"
assert "gpt-3.5" in message.meta["model"]
assert message.meta["finish_reason"] == "stop"

@pytest.mark.skipif(
not os.environ.get("OPENAI_API_KEY", None),
Expand Down Expand Up @@ -311,8 +311,8 @@ def __call__(self, chunk: StreamingChunk) -> None:
message: ChatMessage = results["replies"][0]
assert "Paris" in message.content

assert "gpt-3.5" in message.metadata["model"]
assert message.metadata["finish_reason"] == "stop"
assert "gpt-3.5" in message.meta["model"]
assert message.meta["finish_reason"] == "stop"

assert callback.counter > 1
assert "Paris" in callback.responses
8 changes: 4 additions & 4 deletions test/components/generators/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ def test_live_run(self):
component = GPTGenerator(api_key=os.environ.get("OPENAI_API_KEY"))
results = component.run("What's the capital of France?")
assert len(results["replies"]) == 1
assert len(results["metadata"]) == 1
assert len(results["meta"]) == 1
response: str = results["replies"][0]
assert "Paris" in response

metadata = results["metadata"][0]
metadata = results["meta"][0]
assert "gpt-3.5" in metadata["model"]
assert metadata["finish_reason"] == "stop"

Expand Down Expand Up @@ -314,11 +314,11 @@ def __call__(self, chunk: StreamingChunk) -> None:
results = component.run("What's the capital of France?")

assert len(results["replies"]) == 1
assert len(results["metadata"]) == 1
assert len(results["meta"]) == 1
response: str = results["replies"][0]
assert "Paris" in response

metadata = results["metadata"][0]
metadata = results["meta"][0]

assert "gpt-3.5" in metadata["model"]
assert metadata["finish_reason"] == "stop"
Expand Down
Loading