Skip to content

Commit

Permalink
fix: fix function imports (letta-ai#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahwooders authored Sep 3, 2024
1 parent b4dca3e commit 9acf931
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions memgpt/functions/function_sets/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import datetime
import math
from typing import Optional

from memgpt.agent import Agent
from memgpt.constants import MAX_PAUSE_HEARTBEATS, RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
from memgpt.utils import json_dumps
from memgpt.constants import MAX_PAUSE_HEARTBEATS

# import math
# from memgpt.utils import json_dumps

### Functions / tools the agent can use
# All functions should return a response string (or None)
Expand Down Expand Up @@ -39,6 +39,10 @@ def send_message(self: Agent, message: str) -> Optional[str]:


def pause_heartbeats(self: Agent, minutes: int) -> Optional[str]:
import datetime

from memgpt.constants import MAX_PAUSE_HEARTBEATS

minutes = min(MAX_PAUSE_HEARTBEATS, minutes)

# Record the current time
Expand All @@ -63,6 +67,12 @@ def conversation_search(self: Agent, query: str, page: Optional[int] = 0) -> Opt
Returns:
str: Query result string
"""

import math

from memgpt.constants import RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
from memgpt.utils import json_dumps

if page is None or (isinstance(page, str) and page.lower().strip() == "none"):
page = 0
try:
Expand Down Expand Up @@ -93,6 +103,11 @@ def conversation_search_date(self: Agent, start_date: str, end_date: str, page:
Returns:
str: Query result string
"""
import math

from memgpt.constants import RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
from memgpt.utils import json_dumps

if page is None or (isinstance(page, str) and page.lower().strip() == "none"):
page = 0
try:
Expand Down Expand Up @@ -136,6 +151,11 @@ def archival_memory_search(self: Agent, query: str, page: Optional[int] = 0) ->
Returns:
str: Query result string
"""
import math

from memgpt.constants import RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
from memgpt.utils import json_dumps

if page is None or (isinstance(page, str) and page.lower().strip() == "none"):
page = 0
try:
Expand Down

0 comments on commit 9acf931

Please sign in to comment.