Skip to content

Commit dc414cb

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Add docstring to clarify that inmemory service are not suitable for production
environment Resolves #1569 PiperOrigin-RevId: 780013850
1 parent a021222 commit dc414cb

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/google/adk/artifacts/in_memory_artifact_service.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
"""An in-memory implementation of the artifact service."""
14+
from __future__ import annotations
1615

1716
import logging
1817
from typing import Optional
@@ -28,7 +27,11 @@
2827

2928

3029
class InMemoryArtifactService(BaseArtifactService, BaseModel):
31-
"""An in-memory implementation of the artifact service."""
30+
"""An in-memory implementation of the artifact service.
31+
32+
It is not suitable for multi-threaded production environments. Use it for
33+
testing and development only.
34+
"""
3235

3336
artifacts: dict[str, list[types.Part]] = Field(default_factory=dict)
3437

src/google/adk/memory/in_memory_memory_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
1614
from __future__ import annotations
1715

1816
import re
@@ -43,6 +41,9 @@ class InMemoryMemoryService(BaseMemoryService):
4341
"""An in-memory memory service for prototyping purpose only.
4442
4543
Uses keyword matching instead of semantic search.
44+
45+
It is not suitable for multi-threaded production environments. Use it for
46+
testing and development only.
4647
"""
4748

4849
def __init__(self):

src/google/adk/sessions/in_memory_session_service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333

3434

3535
class InMemorySessionService(BaseSessionService):
36-
"""An in-memory implementation of the session service."""
36+
"""An in-memory implementation of the session service.
37+
38+
It is not suitable for multi-threaded production environments. Use it for
39+
testing and development only.
40+
"""
3741

3842
def __init__(self):
3943
# A map from app name to a map from user ID to a map from session ID to

0 commit comments

Comments
 (0)