diff --git a/benchmark/dbally_benchmark/e2e_benchmark.py b/benchmark/dbally_benchmark/e2e_benchmark.py index aa686727..f2d86b58 100644 --- a/benchmark/dbally_benchmark/e2e_benchmark.py +++ b/benchmark/dbally_benchmark/e2e_benchmark.py @@ -31,7 +31,7 @@ async def _run_dbally_for_single_example(example: BIRDExample, collection: Collection) -> Text2SQLResult: try: result = await collection.ask(example.question, dry_run=True) - sql = result.context["sql"] + sql = result.metadata["sql"] except UnsupportedQueryError: sql = "UnsupportedQueryError" except NoViewFoundError: diff --git a/docs/how-to/use_elastic_vector_store_code.py b/docs/how-to/use_elastic_vector_store_code.py index 4817fcf4..48c3309f 100644 --- a/docs/how-to/use_elastic_vector_store_code.py +++ b/docs/how-to/use_elastic_vector_store_code.py @@ -91,7 +91,7 @@ async def main(country="United States", years_of_experience="2"): f"Find someone from the {country} with more than {years_of_experience} years of experience." ) - print(f"The generated SQL query is: {result.context.get('sql')}") + print(f"The generated SQL query is: {result.metadata.get('sql')}") print() print(f"Retrieved {len(result.results)} candidates:") for candidate in result.results: diff --git a/docs/how-to/use_elasticsearch_store_code.py b/docs/how-to/use_elasticsearch_store_code.py index 1f690c35..181a3c89 100644 --- a/docs/how-to/use_elasticsearch_store_code.py +++ b/docs/how-to/use_elasticsearch_store_code.py @@ -95,7 +95,7 @@ async def main(country="United States", years_of_experience="2"): f"Find someone from the {country} with more than {years_of_experience} years of experience." ) - print(f"The generated SQL query is: {result.context.get('sql')}") + print(f"The generated SQL query is: {result.metadata.get('sql')}") print() print(f"Retrieved {len(result.results)} candidates:") for candidate in result.results: diff --git a/docs/how-to/views/custom_views_code.py b/docs/how-to/views/custom_views_code.py index 33c954c7..573eddc7 100644 --- a/docs/how-to/views/custom_views_code.py +++ b/docs/how-to/views/custom_views_code.py @@ -64,7 +64,7 @@ def execute(self, dry_run: bool = False) -> ViewExecutionResult: print(self._filter) filtered_data = list(filter(self._filter, self.get_data())) - return ViewExecutionResult(results=filtered_data, context={}) + return ViewExecutionResult(results=filtered_data, metadata={}) class CandidateView(FilteredIterableBaseView): def get_data(self) -> Iterable: diff --git a/docs/quickstart/quickstart2_code.py b/docs/quickstart/quickstart2_code.py index 593e7b4a..fd6c6b8c 100644 --- a/docs/quickstart/quickstart2_code.py +++ b/docs/quickstart/quickstart2_code.py @@ -85,7 +85,7 @@ async def main(): result = await collection.ask("Find someone from the United States with more than 2 years of experience.") - print(f"The generated SQL query is: {result.context.get('sql')}") + print(f"The generated SQL query is: {result.metadata.get('sql')}") print() print(f"Retrieved {len(result.results)} candidates:") for candidate in result.results: diff --git a/docs/quickstart/quickstart_code.py b/docs/quickstart/quickstart_code.py index 34ee9765..0e302537 100644 --- a/docs/quickstart/quickstart_code.py +++ b/docs/quickstart/quickstart_code.py @@ -63,7 +63,7 @@ async def main(): result = await collection.ask("Find me French candidates suitable for a senior data scientist position.") - print(f"The generated SQL query is: {result.context.get('sql')}") + print(f"The generated SQL query is: {result.metadata.get('sql')}") print() print(f"Retrieved {len(result.results)} candidates:") for candidate in result.results: