chore: Add docstring to clarify that inmemory service are not suitable for production

environment

Resolves https://github.com/google/adk-python/issues/1569

PiperOrigin-RevId: 780013850
This commit is contained in:
Shangjie Chen
2025-07-07 02:13:24 -07:00
committed by Copybara-Service
parent a021222077
commit dc414cb507
3 changed files with 14 additions and 6 deletions
@@ -11,8 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""An in-memory implementation of the artifact service."""
from __future__ import annotations
import logging
from typing import Optional
@@ -28,7 +27,11 @@ logger = logging.getLogger("google_adk." + __name__)
class InMemoryArtifactService(BaseArtifactService, BaseModel):
"""An in-memory implementation of the artifact service."""
"""An in-memory implementation of the artifact service.
It is not suitable for multi-threaded production environments. Use it for
testing and development only.
"""
artifacts: dict[str, list[types.Part]] = Field(default_factory=dict)
@@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
import re
@@ -43,6 +41,9 @@ class InMemoryMemoryService(BaseMemoryService):
"""An in-memory memory service for prototyping purpose only.
Uses keyword matching instead of semantic search.
It is not suitable for multi-threaded production environments. Use it for
testing and development only.
"""
def __init__(self):
@@ -33,7 +33,11 @@ logger = logging.getLogger('google_adk.' + __name__)
class InMemorySessionService(BaseSessionService):
"""An in-memory implementation of the session service."""
"""An in-memory implementation of the session service.
It is not suitable for multi-threaded production environments. Use it for
testing and development only.
"""
def __init__(self):
# A map from app name to a map from user ID to a map from session ID to