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
280 changes: 147 additions & 133 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions aixplain/factories/team_agent_factory/inspector_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
and monitor team agent operations. Inspectors can be created from existing models
or using automatic configurations.

WARNING: This feature is currently in private beta.

Example:
Create an inspector from a model with adaptive policy::

Expand Down
6 changes: 4 additions & 2 deletions aixplain/modules/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def run(
wait_time: float = 0.5,
content: Optional[Union[Dict[Text, Text], List[Text]]] = None,
max_tokens: int = 4096,
max_iterations: int = 3,
max_iterations: int = 5,
output_format: Optional[OutputFormat] = None,
expected_output: Optional[Union[BaseModel, Text, dict]] = None,
) -> AgentResponse:
Expand Down Expand Up @@ -307,6 +307,8 @@ def run(
if history:
validate_history(history)
result_data = {}
if len(self.tasks) > 0:
max_iterations = 30
try:
response = self.run_async(
data=data,
Expand Down Expand Up @@ -370,7 +372,7 @@ def run_async(
parameters: Dict = {},
content: Optional[Union[Dict[Text, Text], List[Text]]] = None,
max_tokens: int = 2048,
max_iterations: int = 10,
max_iterations: int = 5,
output_format: Optional[OutputFormat] = None,
expected_output: Optional[Union[BaseModel, Text, dict]] = None,
) -> AgentResponse:
Expand Down
2 changes: 2 additions & 0 deletions aixplain/modules/team_agent/inspector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Pre-defined agent for inspecting the data flow within a team agent.

WARNING: This feature is currently in private beta.

Example usage:

inspector = Inspector(
Expand Down
169 changes: 169 additions & 0 deletions docs/api-reference/python/aixplain/base/parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
---
sidebar_label: parameters
title: aixplain.base.parameters
---

### Parameter Objects

```python
@dataclass
class Parameter()
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L6)

A class representing a single parameter with its properties.

**Attributes**:

- `name` _str_ - The name of the parameter.
- `required` _bool_ - Whether the parameter is required or optional.
- `value` _Optional[Any]_ - The value of the parameter. Defaults to None.

### BaseParameters Objects

```python
class BaseParameters()
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L19)

A base class for managing a collection of parameters.

This class provides functionality to store, access, and manipulate parameters
in a structured way. Parameters can be accessed using attribute syntax or
dictionary-style access.

**Attributes**:

- `parameters` _Dict[str, Parameter]_ - Dictionary storing Parameter objects.

#### \_\_init\_\_

```python
def __init__() -> None
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L29)

Initialize the BaseParameters class.

The initialization creates an empty dictionary to store parameters.

#### get\_parameter

```python
def get_parameter(name: str) -> Optional[Parameter]
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L36)

Get a parameter by name.

**Arguments**:

- `name` _str_ - Name of the parameter


**Returns**:

- `Optional[Parameter]` - Parameter object if found, None otherwise

#### to\_dict

```python
def to_dict() -> Dict[str, Dict[str, Any]]
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L47)

Convert parameters back to dictionary format.

**Returns**:

Dict[str, Dict[str, Any]]: Dictionary representation of parameters

#### to\_list

```python
def to_list() -> List[str]
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L55)

Convert parameters to a list format.

This method creates a list of dictionaries containing the name and value
of each parameter that has a value set.

**Returns**:

- `List[str]` - A list of dictionaries, each containing 'name' and 'value'
keys for parameters that have values set.

#### \_\_str\_\_

```python
def __str__() -> str
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L67)

Create a pretty string representation of the parameters.

**Returns**:

- `str` - Formatted string showing all parameters

#### \_\_setattr\_\_

```python
def __setattr__(name: str, value: Any) -> None
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L84)

Allow setting parameters using attribute syntax.

This special method enables setting parameter values using attribute syntax
(e.g., params.text = "Hello"). It only works for parameters that have been
previously defined.

**Arguments**:

- `name` _str_ - Name of the parameter to set.
- `value` _Any_ - Value to assign to the parameter.


**Raises**:

- `AttributeError` - If attempting to set a parameter that hasn't been defined.

#### \_\_getattr\_\_

```python
def __getattr__(name: str) -> Any
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/base/parameters.py#L107)

Allow getting parameter values using attribute syntax.

This special method enables accessing parameter values using attribute syntax
(e.g., params.text). It only works for parameters that have been previously
defined.

**Arguments**:

- `name` _str_ - Name of the parameter to access.


**Returns**:

- `Any` - The value of the requested parameter.


**Raises**:

- `AttributeError` - If attempting to access a parameter that hasn't been defined.

26 changes: 26 additions & 0 deletions docs/api-reference/python/aixplain/cli_groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
sidebar_label: cli_groups
title: aixplain.cli_groups
---

#### \_\_author\_\_

Copyright 2022 The aiXplain SDK authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Author: Michael Lam
Date: September 18th 2023
Description:
CLI Runner

40 changes: 40 additions & 0 deletions docs/api-reference/python/aixplain/decorators/api_key_checker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
sidebar_label: api_key_checker
title: aixplain.decorators.api_key_checker
---

#### check\_api\_key

```python
def check_api_key(method)
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/decorators/api_key_checker.py#L4)

Decorator to verify that an API key is set before executing the method.

This decorator checks if either TEAM_API_KEY or AIXPLAIN_API_KEY is set in the
configuration. If neither key is set, it raises an exception.

**Arguments**:

- `method` _callable_ - The method to be decorated.


**Returns**:

- `callable` - The wrapped method that includes API key verification.


**Raises**:

- `Exception` - If neither TEAM_API_KEY nor AIXPLAIN_API_KEY is set.


**Example**:

@check_api_key
def my_api_method():
# Method implementation
pass

6 changes: 6 additions & 0 deletions docs/api-reference/python/aixplain/decorators/init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
draft: true
sidebar_label: decorators
title: aixplain.decorators
---

61 changes: 61 additions & 0 deletions docs/api-reference/python/aixplain/enums/asset_status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
sidebar_label: asset_status
title: aixplain.enums.asset_status
---

#### \_\_author\_\_

Copyright 2024 The aiXplain SDK authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Author: Duraikrishna Selvaraju, Thiago Castro Ferreira, Shreyas Sharma and Lucas Pavanelli
Date: February 21st 2024
Description:
Asset Enum

### AssetStatus Objects

```python
class AssetStatus(Text, Enum)
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/enums/asset_status.py#L28)

Enumeration of possible status values for an asset in the aiXplain system.

This enum defines all possible states that an asset can be in throughout its lifecycle,
from creation to deletion. Each enum value corresponds to a specific state in the
asset's lifecycle.

**Attributes**:

- `DRAFT` _str_ - Initial state for a newly created asset.
- `HIDDEN` _str_ - Asset is hidden from public view.
- `SCHEDULED` _str_ - Asset is scheduled for processing.
- `ONBOARDING` _str_ - Asset is in the process of being onboarded.
- `ONBOARDED` _str_ - Asset has been successfully onboarded.
- `PENDING` _str_ - Asset is waiting for processing.
- `FAILED` _str_ - Asset processing has failed.
- `TRAINING` _str_ - Asset is currently in training.
- `REJECTED` _str_ - Asset has been rejected.
- `ENABLING` _str_ - Asset is in the process of being enabled.
- `HIDDEN`0 _str_ - Asset is in the process of being deleted.
- `HIDDEN`1 _str_ - Asset has been disabled.
- `HIDDEN`2 _str_ - Asset has been deleted.
- `HIDDEN`3 _str_ - Asset is currently being processed.
- `HIDDEN`4 _str_ - Asset has completed processing.
- `HIDDEN`5 _str_ - Asset operation is being canceled.
- `HIDDEN`6 _str_ - Asset operation has been canceled.
- `HIDDEN`7 _str_ - Draft state that has been deprecated.

37 changes: 37 additions & 0 deletions docs/api-reference/python/aixplain/enums/code_interpreter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
sidebar_label: code_interpreter
title: aixplain.enums.code_interpreter
---

### CodeInterpreterModel Objects

```python
class CodeInterpreterModel(str, Enum)
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/enums/code_interpreter.py#L4)

Enumeration of available Code Interpreter model identifiers.

This enum defines the unique identifiers for different code interpreter models
available in the system. Each value represents a specific model's ID that can
be used for code interpretation tasks.

**Attributes**:

- `PYTHON_AZURE` _str_ - Model ID for the Python code interpreter running on Azure.

#### \_\_str\_\_

```python
def __str__() -> str
```

[[view_source]](https://github.com/aixplain/aiXplain/blob/main/aixplain/enums/code_interpreter.py#L17)

Return the string representation of the model ID.

**Returns**:

- `str` - The model ID value as a string.

Loading