mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context Resolves: #2591 <!-- 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. --> ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> * Added in the `MongoDBAtlasMemoryStore`. A memory store abstraction that facilitates connections between a MongoDB Atlas cluster to conduct [Atlas Vector Search](https://www.mongodb.com/products/platform/atlas-vector-search) on the Microsoft Semantic Kernel. * Leverages our async python driver [motor](https://motor.readthedocs.io/en/stable/) to keep with the heuristic of asynchronous code ### 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 - [x] I didn't break anyone 😄 ### Callout * When writing my test, I noticed there's a habit of other tests conducting a `try` on imports. Grepping through those implementations, I see some of them [encapsulate their respective libraries in function calls rather than doing direct imports in the module.](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/memory/chroma/chroma_memory_store.py#L55-L63) Is this the general code pattern we should follow? Or is it fine to have our imports at the top of the module fine? --------- Co-authored-by: Steven Silvester <[email protected]> Co-authored-by: Abby Harrison <[email protected]> Co-authored-by: Abby Harrison <[email protected]>
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
from semantic_kernel import core_skills, memory
|
|
from semantic_kernel.kernel import Kernel
|
|
from semantic_kernel.orchestration.context_variables import ContextVariables
|
|
from semantic_kernel.orchestration.sk_context import SKContext
|
|
from semantic_kernel.orchestration.sk_function_base import SKFunctionBase
|
|
from semantic_kernel.semantic_functions.chat_prompt_template import ChatPromptTemplate
|
|
from semantic_kernel.semantic_functions.prompt_template import PromptTemplate
|
|
from semantic_kernel.semantic_functions.prompt_template_config import (
|
|
PromptTemplateConfig,
|
|
)
|
|
from semantic_kernel.semantic_functions.semantic_function_config import (
|
|
SemanticFunctionConfig,
|
|
)
|
|
from semantic_kernel.utils.null_logger import NullLogger
|
|
from semantic_kernel.utils.settings import (
|
|
azure_openai_settings_from_dot_env,
|
|
bing_search_settings_from_dot_env,
|
|
google_palm_settings_from_dot_env,
|
|
mongodb_atlas_settings_from_dot_env,
|
|
openai_settings_from_dot_env,
|
|
pinecone_settings_from_dot_env,
|
|
postgres_settings_from_dot_env,
|
|
redis_settings_from_dot_env,
|
|
)
|
|
|
|
__all__ = [
|
|
"Kernel",
|
|
"NullLogger",
|
|
"openai_settings_from_dot_env",
|
|
"azure_openai_settings_from_dot_env",
|
|
"postgres_settings_from_dot_env",
|
|
"pinecone_settings_from_dot_env",
|
|
"bing_search_settings_from_dot_env",
|
|
"mongodb_atlas_settings_from_dot_env",
|
|
"google_palm_settings_from_dot_env",
|
|
"redis_settings_from_dot_env",
|
|
"PromptTemplateConfig",
|
|
"PromptTemplate",
|
|
"ChatPromptTemplate",
|
|
"SemanticFunctionConfig",
|
|
"ContextVariables",
|
|
"SKFunctionBase",
|
|
"SKContext",
|
|
"memory",
|
|
"core_skills",
|
|
]
|