Skip to content

Commit

Permalink
Merge pull request #2346 from Agenta-AI/release/v0.28.1
Browse files Browse the repository at this point in the history
Release/v0.28.1
  • Loading branch information
jp-agenta authored Dec 9, 2024
2 parents d7c4e91 + 200ae95 commit 6eac729
Show file tree
Hide file tree
Showing 8 changed files with 835 additions and 872 deletions.
10 changes: 8 additions & 2 deletions agenta-backend/agenta_backend/models/api/evaluation_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime
from typing import Optional, List, Dict, Any, Union

from pydantic import BaseModel, Field, model_validator
from pydantic import BaseModel, Field, model_validator, field_validator

from agenta_backend.utils import traces
from agenta_backend.models.api.api_models import Result
Expand Down Expand Up @@ -293,9 +293,15 @@ class NewEvaluation(BaseModel):
evaluators_configs: List[str]
testset_id: str
rate_limit: LLMRunRateLimit
lm_providers_keys: Optional[Dict[LMProvidersEnum, str]] = None
lm_providers_keys: Optional[Dict[str, str]] = None
correct_answer_column: Optional[str] = None

@field_validator("lm_providers_keys", mode="after")
def validate_lm_providers_keys(cls, value):
if value is not None:
return {LMProvidersEnum(key): v for key, v in value.items()}
return value


class NewEvaluatorConfig(BaseModel):
app_id: str
Expand Down
22 changes: 17 additions & 5 deletions agenta-backend/agenta_backend/services/llm_apps_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,24 @@ def extract_result_from_response(response: dict):
if "tree" in response:
trace_tree = response.get("tree", {}).get("nodes", [])[0]

latency = (
get_nested_value(
trace_tree, ["metrics", "acc", "duration", "total"]
)
/ 1000
duration_ms = get_nested_value(
trace_tree, ["metrics", "acc", "duration", "total"]
)
if duration_ms:
duration_seconds = duration_ms / 1000
else:
start_time = get_nested_value(trace_tree, ["time", "start"])
end_time = get_nested_value(trace_tree, ["time", "end"])

if start_time and end_time:
duration_seconds = (
datetime.fromisoformat(end_time)
- datetime.fromisoformat(start_time)
).total_seconds()
else:
duration_seconds = None

latency = duration_seconds
cost = get_nested_value(
trace_tree, ["metrics", "acc", "costs", "total"]
)
Expand Down
2 changes: 2 additions & 0 deletions agenta-backend/agenta_backend/tasks/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ def evaluate(
]

# 4. We save the result of the eval scenario in the db
print("============ App Output ============: ", app_output.result.value)

loop.run_until_complete(
create_new_evaluation_scenario(
project_id=project_id,
Expand Down
1,661 changes: 802 additions & 859 deletions agenta-backend/poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions agenta-backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta_backend"
version = "0.28.0"
version = "0.28.1"
description = ""
authors = ["Mahmoud Mabrouk <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -41,7 +41,7 @@ tqdm = "^4.66.6"
alembic = "^1.13.2"
numpy = "1.26.3"
autoevals = "^0.0.83"
supertokens-python = "^0.24.2"
supertokens-python = "^0.26.1"
protobuf = "^4.25.4"
litellm ="^1.48.0"

Expand Down
2 changes: 1 addition & 1 deletion agenta-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta"
version = "0.28.0"
version = "0.28.1"
description = "The SDK for agenta is an open-source LLMOps platform."
readme = "README.md"
authors = ["Mahmoud Mabrouk <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions agenta-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agenta-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agenta",
"version": "0.28.0",
"version": "0.28.1",
"private": true,
"engines": {
"node": ">=18"
Expand Down

0 comments on commit 6eac729

Please sign in to comment.