Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llm logs fix #1708

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kairon/shared/llm/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def get_logs(bot: str, start_idx: int = 0, page_size: int = 10):
@param page_size: page size
@return: list of logs.
"""
for log in LLMLogs.objects(metadata__bot=bot).order_by("-start_time").skip(start_idx).limit(page_size):
for log in LLMLogs.objects(metadata__bot=bot).order_by("-start_time").skip(start_idx).limit(page_size).exclude('response.data'):
llm_log = log.to_mongo().to_dict()
llm_log.pop('_id')
yield llm_log
Expand Down
3 changes: 2 additions & 1 deletion tests/integration_test/services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28671,6 +28671,7 @@ def test_get_llm_logs():
headers={"Authorization": pytest.token_type + " " + pytest.access_token},
)
actual = response.json()
print(actual)
assert actual["success"]
assert actual["error_code"] == 0
assert len(actual["data"]["logs"]) == 1
Expand All @@ -28684,7 +28685,7 @@ def test_get_llm_logs():
assert actual["data"]["logs"][0]["model_params"] == {}
assert actual["data"]["logs"][0]["metadata"]['bot'] == pytest.bot
assert actual["data"]["logs"][0]["metadata"]['user'] == "test"

assert not actual["data"]["logs"][0].get('response', {}).get("data", None)

def test_add_custom_widget_invalid_config():
response = client.post(
Expand Down
Loading