Skip to content

Commit 871d900

Browse files
committed
add files
1 parent 10c9afa commit 871d900

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Cleanlab experimental modules."""
1+
"""Beta functionality which may not remain backwards compatible."""

src/cleanlab_codex/experimental/strands/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Cleanlab experimental strands integration."""
1+
"""Methods to integrate with AI Agents built using the AWS Strands framework."""
22

33
from cleanlab_codex.experimental.strands.cleanlab_model import CleanlabModel
44

src/cleanlab_codex/experimental/strands/cleanlab_model.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
"""Methods to integrate with AI Agents built using the AWS Strands framework."""
2+
13
from __future__ import annotations
24

35
import json
46
import warnings
57
from typing import TYPE_CHECKING, Any, AsyncGenerator, AsyncIterable, Optional, Type, TypeVar, Union, cast
68

79
from cleanlab_tlm.utils.chat import form_response_string_chat_completions_api
8-
from openai.types.chat import ChatCompletionMessageParam, ChatCompletionToolParam
910
from strands.models.model import Model # type: ignore[import-not-found]
1011
from strands.models.openai import OpenAIModel # type: ignore[import-not-found]
1112
from strands.types.tools import ToolSpec, ToolUse # type: ignore[import-not-found]
1213

1314
if TYPE_CHECKING:
1415
from codex.types.project_validate_response import ProjectValidateResponse
16+
from openai.types.chat import ChatCompletionMessageParam, ChatCompletionToolParam
1517
from strands.agent.agent import Agent # type: ignore[import-not-found]
1618
from strands.types.content import ContentBlock, Messages # type: ignore[import-not-found]
1719
from strands.types.streaming import StreamEvent # type: ignore[import-not-found]
@@ -518,8 +520,8 @@ def _cleanlab_validate(
518520
eval_scores = {"trustworthiness": 1.0, "response_helpfulness": 1.0}
519521
validation_results = self.cleanlab_project.validate(
520522
response=form_response_string_chat_completions_api(openai_collected_content),
521-
messages=cast(list[ChatCompletionMessageParam], convert_strands_messages_for_cleanlab(messages)),
522-
tools=cast(list[ChatCompletionToolParam], convert_strands_tools_to_openai_format(tool_specs))
523+
messages=cast(list["ChatCompletionMessageParam"], convert_strands_messages_for_cleanlab(messages)),
524+
tools=cast(list["ChatCompletionToolParam"], convert_strands_tools_to_openai_format(tool_specs))
523525
if tool_specs
524526
else None,
525527
metadata={"thread_id": session_id, "stop_reason": stop_reason},
@@ -529,8 +531,8 @@ def _cleanlab_validate(
529531
else:
530532
validation_results = self.cleanlab_project.validate(
531533
response=form_response_string_chat_completions_api(openai_collected_content),
532-
messages=cast(list[ChatCompletionMessageParam], convert_strands_messages_for_cleanlab(messages)),
533-
tools=cast(list[ChatCompletionToolParam], convert_strands_tools_to_openai_format(tool_specs))
534+
messages=cast(list["ChatCompletionMessageParam"], convert_strands_messages_for_cleanlab(messages)),
535+
tools=cast(list["ChatCompletionToolParam"], convert_strands_tools_to_openai_format(tool_specs))
534536
if tool_specs
535537
else None,
536538
metadata={"thread_id": session_id, "stop_reason": stop_reason},

0 commit comments

Comments
 (0)