Skip to content

Commit c250b37

Browse files
Python: Refinement of in memory vector collection filter (#13637)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Fixes another way of escaping allowed commands. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent d5c2b9d commit c250b37

File tree

6 files changed

+592
-23
lines changed

6 files changed

+592
-23
lines changed

python/semantic_kernel/agents/bedrock/bedrock_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async def create_and_prepare_agent(
216216
env_file_encoding=env_file_encoding,
217217
)
218218
except ValidationError as e:
219-
raise AgentInitializationException("Failed to initialize the Amazon Bedrock Agent settings.") from e
219+
raise AgentInitializationException(f"Failed to initialize the Amazon Bedrock Agent settings: {e}") from e
220220

221221
import boto3
222222
from botocore.exceptions import ClientError
@@ -237,7 +237,7 @@ async def create_and_prepare_agent(
237237
)
238238
except ClientError as e:
239239
logger.error(f"Failed to create agent {name}.")
240-
raise AgentInitializationException("Failed to create the Amazon Bedrock Agent.") from e
240+
raise AgentInitializationException(f"Failed to create the Amazon Bedrock Agent: {e}") from e
241241

242242
bedrock_agent = cls(
243243
response["agent"],

python/semantic_kernel/connectors/azure_cosmos_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ def _lambda_parser(self, node: ast.AST) -> Any:
922922
case ast.Constant():
923923
# Quote strings, leave numbers as is
924924
if isinstance(node.value, str):
925-
return f"'{node.value}'"
925+
return "'" + node.value.replace("'", "''") + "'"
926926
if isinstance(node.value, (float, int)):
927927
return str(node.value)
928928
if node.value is None:

0 commit comments

Comments
 (0)