Skip to content
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
13 changes: 5 additions & 8 deletions aixplain/modules/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,6 @@ def _format_agent_progress(
if tool:
msg = f"⚙️ {agent_name} | {tool} | {status_icon}"

if runtime is not None and runtime > 0 and success is not None:
msg += f" ({runtime:.1f} s)"

if tool_input:
msg += f" | Input: {tool_input}"

Expand Down Expand Up @@ -604,27 +601,27 @@ def run(
Dict: parsed output from model
"""
start = time.time()

# Extract deprecated parameters from kwargs
output_format = kwargs.get("output_format", None)
expected_output = kwargs.get("expected_output", None)

if output_format is not None:
warnings.warn(
"The 'output_format' parameter is deprecated and will be removed in a future version. "
"Set the output format during agent initialization instead.",
DeprecationWarning,
stacklevel=2,
)

if expected_output is not None:
warnings.warn(
"The 'expected_output' parameter is deprecated and will be removed in a future version. "
"Set the expected output during agent initialization instead.",
DeprecationWarning,
stacklevel=2,
)

if session_id is not None and history is not None:
raise ValueError("Provide either `session_id` or `history`, not both.")

Expand Down Expand Up @@ -661,7 +658,7 @@ def run(
poll_url, name=name, timeout=timeout, wait_time=wait_time, progress_verbosity=progress_verbosity
)
if result.status == ResponseStatus.FAILED:
raise Exception("Model failed to run with error: " + result.error_message)
raise Exception("Model failed to run with error: " + result.error_message)
result_data = result.get("data") or {}
return AgentResponse(
status=ResponseStatus.SUCCESS,
Expand Down
40 changes: 32 additions & 8 deletions aixplain/modules/team_agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TeamAgent(Model, DeployableMixin[Agent]):
instructions (Optional[Text]): Instructions to guide the team agent.
output_format (OutputFormat): Response format. Defaults to TEXT.
expected_output (Optional[Union[BaseModel, Text, dict]]): Expected output format.

Deprecated Attributes:
llm_id (Text): DEPRECATED. Use 'llm' parameter instead. Large language model ID.
mentalist_llm (Optional[LLM]): DEPRECATED. LLM for planning.
Expand Down Expand Up @@ -132,6 +132,32 @@ def __init__(
expected_output: Optional[Union[BaseModel, Text, dict]] = None,
**additional_info,
) -> None:
"""Initialize a TeamAgent instance.

Args:
id (Text): Unique identifier for the team agent.
name (Text): Name of the team agent.
agents (List[Agent], optional): List of agents in the team. Defaults to [].
description (Text, optional): Description of the team agent. Defaults to "".
llm (Optional[LLM], optional): LLM instance. Defaults to None.
supervisor_llm (Optional[LLM], optional): Supervisor LLM instance. Defaults to None.
api_key (Optional[Text], optional): API key. Defaults to config.TEAM_API_KEY.
supplier (Union[Dict, Text, Supplier, int], optional): Supplier. Defaults to "aiXplain".
version (Optional[Text], optional): Version. Defaults to None.
cost (Optional[Dict], optional): Cost information. Defaults to None.
inspectors (List[Inspector], optional): List of inspectors. Defaults to [].
inspector_targets (List[InspectorTarget], optional): Inspector targets. Defaults to [InspectorTarget.STEPS].
status (AssetStatus, optional): Status of the team agent. Defaults to AssetStatus.DRAFT.
instructions (Optional[Text], optional): Instructions for the team agent. Defaults to None.
output_format (OutputFormat, optional): Output format. Defaults to OutputFormat.TEXT.
expected_output (Optional[Union[BaseModel, Text, dict]], optional): Expected output format. Defaults to None.
**additional_info: Additional keyword arguments.

Deprecated Args:
llm_id (Text, optional): DEPRECATED. Use 'llm' parameter instead. ID of the language model. Defaults to "6646261c6eb563165658bbb1".
mentalist_llm (Optional[LLM], optional): DEPRECATED. Mentalist/Planner LLM instance. Defaults to None.
use_mentalist (bool, optional): DEPRECATED. Whether to use mentalist/planner. Defaults to True.
"""
# Handle deprecated parameters from kwargs
if "llm_id" in additional_info:
llm_id = additional_info.pop("llm_id")
Expand All @@ -143,7 +169,7 @@ def __init__(
)
else:
llm_id = "6646261c6eb563165658bbb1"

if "mentalist_llm" in additional_info:
mentalist_llm = additional_info.pop("mentalist_llm")
warnings.warn(
Expand All @@ -153,7 +179,7 @@ def __init__(
)
else:
mentalist_llm = None

if "use_mentalist" in additional_info:
use_mentalist = additional_info.pop("use_mentalist")
warnings.warn(
Expand Down Expand Up @@ -369,9 +395,6 @@ def _format_team_progress(
# Full verbosity: detailed info
msg = f"{emoji} {context} | {status_icon}"

if runtime is not None and runtime > 0 and success is not None:
msg += f" ({runtime:.1f} s)"

if current_step and total_steps:
msg += f" | Step {current_step}/{total_steps}"

Expand Down Expand Up @@ -576,6 +599,7 @@ def run(
max_iterations (int, optional): maximum number of iterations between the agents. Defaults to 30.
trace_request (bool, optional): return the request id for tracing the request. Defaults to False.
progress_verbosity (Optional[str], optional): Progress display mode - "full" (detailed), "compact" (brief), or None (no progress). Defaults to "compact".
**kwargs: Additional deprecated keyword arguments (output_format, expected_output).

Returns:
AgentResponse: parsed output from model
Expand All @@ -589,7 +613,7 @@ def run(
DeprecationWarning,
stacklevel=2,
)

expected_output = kwargs.pop("expected_output", None)
if expected_output is not None:
warnings.warn(
Expand All @@ -598,7 +622,7 @@ def run(
DeprecationWarning,
stacklevel=2,
)

start = time.time()
result_data = {}
if session_id is not None and history is not None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespaces = true

[project]
name = "aiXplain"
version = "0.2.36"
version = "0.2.37"
description = "aiXplain SDK adds AI functions to software."
readme = "README.md"
requires-python = ">=3.9, <4"
Expand Down
Loading