Skip to content

Commit 912bd76

Browse files
[BUZZOK-26356] Synchronize Genai Agents image with af-component-agent (#1514)
* Synchronize Genai Agents image with af-component-agent * Update * Lint * Bump requirements.txt * Bump version * Reconcile dependencies, updated IDs, tags * Unpin chainguard * Update run_agent.py --------- Co-authored-by: svc-harness-git2 <[email protected]>
1 parent aac50fe commit 912bd76

File tree

7 files changed

+260
-93
lines changed

7 files changed

+260
-93
lines changed

public_dropin_environments/python311_genai_agents/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ARG UNAME=notebooks
1414
ARG UID=10101
1515
ARG GID=10101
1616

17-
FROM datarobotdev/mirror_chainguard_datarobot.com_python-fips:3.11-dev-drbuild-1328 AS base
17+
FROM datarobotdev/mirror_chainguard_datarobot.com_python-fips:3.11-dev AS base
1818

1919
ARG UNAME
2020
ARG UID
@@ -36,7 +36,9 @@ ENV PYTHONUNBUFFERED=1 \
3636
PYTHONDONTWRITEBYTECODE=1 \
3737
VENV_PATH=${VENV_PATH} \
3838
PIP_NO_CACHE_DIR=1 \
39-
NOTEBOOKS_KERNEL="python"
39+
NOTEBOOKS_KERNEL="python" \
40+
DEEPEVAL_HOME=/tmp/.deepeval \
41+
DEEPEVAL_TELEMETRY_OPT_OUT="YES"
4042

4143
ENV PATH="$VENV_PATH/bin:$PATH" \
4244
PYTHONPATH="/home/notebooks/.ipython/extensions:/home/notebooks/storage"
@@ -98,7 +100,7 @@ RUN source ${VENV_PATH}/bin/activate && \
98100
uv pip install --no-cache-dir -r ${WORKDIR}/requirements-agent.txt && rm ${WORKDIR}/requirements-agent.txt && \
99101
# Generative AI Agents
100102
uv pip uninstall litellm && \
101-
uv pip install --no-cache-dir git+https://github.com/BerriAI/litellm@v1.72.1.dev1
103+
uv pip install --no-cache-dir litellm>=1.72.1
102104

103105
# Copy agent runtime into work directory
104106
COPY ./run_agent.py ${WORKDIR}/

public_dropin_environments/python311_genai_agents/Dockerfile.local

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ ENV PYTHONUNBUFFERED=1 \
7676
PYTHONDONTWRITEBYTECODE=1 \
7777
VENV_PATH=${VENV_PATH} \
7878
PIP_NO_CACHE_DIR=1 \
79-
NOTEBOOKS_KERNEL="python"
79+
NOTEBOOKS_KERNEL="python" \
80+
DEEPEVAL_HOME=/tmp/.deepeval \
81+
DEEPEVAL_TELEMETRY_OPT_OUT="YES"
8082

8183
ENV PATH="$VENV_PATH/bin:$PATH" \
8284
PYTHONPATH="/home/notebooks/.ipython/extensions:/home/notebooks/storage"
@@ -138,7 +140,7 @@ RUN source ${VENV_PATH}/bin/activate && \
138140
uv pip install --no-cache-dir -r ${WORKDIR}/requirements-agent.txt && rm ${WORKDIR}/requirements-agent.txt && \
139141
# Generative AI Agents
140142
uv pip uninstall litellm && \
141-
uv pip install --no-cache-dir git+https://github.com/BerriAI/litellm@v1.72.1.dev1
143+
uv pip install --no-cache-dir litellm>=1.72.1
142144

143145
# Copy agent runtime into work directory
144146
COPY ./run_agent.py ${WORKDIR}/

public_dropin_environments/python311_genai_agents/env_info.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "This template environment can be used to create GenAI-powered agents using CrewAI, LangGraph, or Llama-Index. Similar to other drop-in environments, you can either include a .pth artifact or any other code needed to deserialize your model, and optionally a custom.py file. You can also use this environment in codespaces.",
55
"programmingLanguage": "python",
66
"label": "",
7-
"environmentVersionId": "6848b58f2081a8179c7a7704",
7+
"environmentVersionId": "6849eae09604e94bd6c25d17",
88
"environmentVersionDescription": "",
99
"isPublic": true,
1010
"useCases": [
@@ -14,8 +14,8 @@
1414
"contextUrl": "https://github.com/datarobot/datarobot-user-models/tree/master/public_dropin_environments/python311_genai_agents",
1515
"imageRepository": "env-python-genai-agents",
1616
"tags": [
17-
"v11.1.0-6848b58f2081a8179c7a7704",
18-
"6848b58f2081a8179c7a7704",
17+
"v11.1.0-6849eae09604e94bd6c25d17",
18+
"6849eae09604e94bd6c25d17",
1919
"v11.1.0-latest"
2020
]
2121
}

public_dropin_environments/python311_genai_agents/extensions/dataframe_formatter.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
from enum import Enum
2121
from typing import Any
2222
from typing import Callable
23-
from typing import Dict
24-
from typing import List
2523
from typing import Optional
2624
from typing import Union
2725
from typing import cast
@@ -75,15 +73,15 @@ class DataframesProcessSteps(str, Enum):
7573
DEFAULT = "get_columns"
7674

7775

78-
Columns = List[Dict[str, Any]]
76+
Columns = list[dict[str, Any]]
7977

8078
DEFAULT_INDEX_KEY = "index"
8179

8280

8381
def _register_exception(
8482
e: Exception,
8583
step: str,
86-
) -> Dict[str, Any]:
84+
) -> dict[str, Any]:
8785
exc_info = sys.exc_info()
8886
traceback_msg = traceback.format_exception(*exc_info)
8987

@@ -174,7 +172,7 @@ def _transform_to_json(data: DataFrame) -> Any:
174172
return json.loads(data.to_json(orient="table", index=True, default_handler=str))["data"]
175173

176174

177-
def _prepare_df_for_chart_cell(val: DataFrame, columns: List[str]) -> Union[DataFrame, List[str]]:
175+
def _prepare_df_for_chart_cell(val: DataFrame, columns: list[str]) -> Union[DataFrame, list[str]]:
178176
if len(columns) == 0:
179177
data = []
180178
elif len(columns) == 1:
@@ -190,9 +188,9 @@ def _prepare_df_for_chart_cell(val: DataFrame, columns: List[str]) -> Union[Data
190188
# This formatter can operate with data that we have received as a DataFrame
191189
def formatter( # noqa: C901,PLR0912
192190
val: "DataFrame",
193-
formatter: Optional[Callable[..., List[str]]] = None,
191+
formatter: Optional[Callable[..., list[str]]] = None,
194192
**formatter_kwargs: Any,
195-
) -> Dict[str, Any]:
193+
) -> dict[str, Any]:
196194
error = []
197195
dataframe_limit = 5000
198196
dataframe_id = id(val)

public_dropin_environments/python311_genai_agents/requirements.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ setuptools
33
ecs-logging
44
jupyter-client
55
jupyter_kernel_gateway
6-
jupyter_core
6+
jupyter_core>=5.8.1
77
ipykernel<6.29.0
88
pandas
99
numpy
1010
mistune
11-
datarobot-drum>=1.16.14
11+
datarobot-drum>=1.16.16
1212
datarobot
1313
numpy
1414
uwsgi
@@ -25,7 +25,8 @@ llama-index-llms-openai
2525
llama-index-llms-langchain
2626
llama-index-llms-litellm
2727
openai
28-
ragas
28+
ragas @ git+https://github.com/explodinggradients/ragas@5d59549ad5ef511f621502c563bc55ac5aeb9188#subdirectory=ragas
29+
datarobot-moderations>=11.1.14
2930

3031
# Generative AI Telemetry
3132
traceloop-sdk

0 commit comments

Comments
 (0)