Skip to content

Commit

Permalink
updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tanweersalah committed Jan 15, 2025
1 parent fd42e43 commit 4963c5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/routers/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ async def check_token_usage(
"""

# Check if any limit is set, if no limit specified do not proceed
if token_limit == -1:
return

from_timestamp, to_timestamp = get_current_day_timestamps_utc()
cluster_id = x_cluster_url.split(".")[1]
total_token_usage = 0
Expand Down
1 change: 1 addition & 0 deletions src/services/langfuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class LangfuseService(metaclass=SingletonMeta):
public_key (str): The public key used for authentication, set to LANGFUSE_PUBLIC_KEY.
secret_key (str): The secret key used for authentication, set to LANGFUSE_SECRET_KEY.
auth (BasicAuth): An authentication object created using the public and secret keys.
_handler (CallbackHandler) : A callback handler for langfuse.
"""

def __init__(self):
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/services/test_langfuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def test_get_total_token_usage(langfuse_service):
@pytest.mark.parametrize(
"messages , input_token_count",
[
# Finalizer answers based on K8S and Kyma agents' responses
# Messages for input
(
[
SystemMessage(
Expand Down Expand Up @@ -114,7 +114,7 @@ async def test_langfuse_end_to_end(
semantic_similarity_metric,
langfuse_service,
):
# Given: A conversation state with messages
# Conversation state with messages
state = create_mock_state(messages)

# Generate a random UUID
Expand All @@ -125,7 +125,7 @@ async def test_langfuse_end_to_end(
"configurable": {
"thread_id": "test_conversation_id",
},
"callbacks": [langfuse_service.handler], # Replace with your callback handler
"callbacks": [langfuse_service.handler],
"tags": [cluster_id],
}

Expand Down

0 comments on commit 4963c5a

Please sign in to comment.