Skip to content
Open
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
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
37 changes: 22 additions & 15 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,76 @@ Thank you for your interest in contributing to ClientAI! This guide is meant to
## Setting Up Your Development Environment

### Cloning the Repository

Start by forking and cloning the ClientAI repository:

```sh
git clone https://github.com/YOUR-GITHUB-USERNAME/clientai.git
```

### Using Poetry for Dependency Management
ClientAI uses Poetry for managing dependencies. If you don't have Poetry installed, follow the instructions on the [official Poetry website](https://python-poetry.org/docs/).

Once Poetry is installed, navigate to the cloned repository and install the dependencies:
```sh
cd clientai
poetry install
```

### Activating the Virtual Environment
Poetry creates a virtual environment for your project. Activate it using:
### Using UV for Dependency Management

ClientAI uses UV for managing dependencies. If you don't have UV installed, follow the instructions on the [official UV website](https://docs.astral.sh/uv/getting-started/installation/).

Once UV is installed, navigate to the cloned repository and install the dependencies:

```sh
poetry shell
uv sync
```

UV creates a virtual environment by itself (.venv) so you do not need to do it by hand or using another tool. Additionally, remember calling every command from UV (`uv run` in front of your command), so the venv will be considered. More examples below.

## Making Contributions

### Coding Standards

- Follow PEP 8 guidelines.
- Write meaningful tests for new features or bug fixes.

### Testing with Pytest

ClientAI uses pytest for testing. Run tests using:

```sh
poetry run pytest
uv run pytest
```

### Linting

Use mypy for type checking:

```sh
mypy clientai
uv run mypy clientai
```

Use ruff for style:

```sh
ruff check --fix
ruff format
uv run ruff check --fix
uv run ruff format
```

Ensure your code passes linting before submitting.

## Submitting Your Contributions

### Creating a Pull Request

After making your changes:

- Push your changes to your fork.
- Open a pull request with a clear description of your changes.
- Update the README.md if necessary.


### Code Reviews

- Address any feedback from code reviews.
- Once approved, your contributions will be merged into the main branch.

## Code of Conduct

Please adhere to our [Code of Conduct](CODE_OF_CONDUCT.md) to maintain a welcoming and inclusive environment.

Thank you for contributing to ClientAI🚀
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Pull Request Template for ClientAI

## Description

Please provide a clear and concise description of what your pull request is about.

## Changes

Briefly list the changes you've made. If applicable, also link any relevant issues or pull requests.

## Tests

Describe the tests you added or modified to cover your changes, if applicable.

## Checklist

- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) document.
- [ ] My code follows the code style of this project.
- [ ] I have added necessary documentation (if appropriate).
- [ ] I have added tests that cover my changes (if applicable).
- [ ] All new and existing tests passed.

## Additional Notes

Include any additional information that you think is important for reviewers to know.
12 changes: 6 additions & 6 deletions README.md → .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def calculate_average(numbers: list[float]) -> float:

analyzer = create_agent(
client=client("groq", api_key="your-groq-key"),
role="analyzer",
role="analyzer",
system_prompt="You are a helpful data analysis assistant.",
model="llama-3.2-3b-preview",
tools=[calculate_average]
Expand Down Expand Up @@ -164,10 +164,10 @@ The ClientAI Agent module is built on four core principles:
2. **Customization First**: Every component is designed to be extended or overridden. Create custom steps, tool selectors, or entirely new workflow patterns.

3. **Zero Lock-In**: Start with high-level components and drop down to lower levels as needed. You can:
- Extend `Agent` for custom behavior
- Use individual components directly
- Gradually replace parts with your own implementation
- Or migrate away entirely - no lock-in
- Extend `Agent` for custom behavior
- Use individual components directly
- Gradually replace parts with your own implementation
- Or migrate away entirely - no lock-in

## Requirements

Expand All @@ -185,4 +185,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## Contact

Igor Magalhaes – [@igormagalhaesr](https://twitter.com/igormagalhaesr) – [email protected]
[github.com/igorbenav](https://github.com/igorbenav/)
[github.com/igorbenav](https://github.com/igorbenav/)
8 changes: 0 additions & 8 deletions mypy.ini

This file was deleted.

109 changes: 65 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
[tool.poetry]
# [build-system]
# requires = ["setuptools", "wheel"]
# build-backend = "setuptools.build_meta"


[project]
name = "clientai"
version = "0.5.0"
description = "A unified client for AI providers with built-in agent support."
authors = ["Igor Benav <[email protected]>"]
readme = "README.md"
version = "0.5.0"
readme = { file = ".github/README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
authors = [{ name = "Igor Benav", email = "[email protected]" }]
maintainers = [{ name = "Igor Benav", email = "[email protected]" }]
requires-python = ">=3.9"

keywords = ["ai", "agents", "llm", "nlp", "language-model", "ai-agents"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand All @@ -24,47 +33,49 @@ classifiers = [
"Operating System :: OS Independent",
"Typing :: Typed",
]
dependencies = ["httpx>=0.27.2", "pydantic>=2.10.5"]

keywords = ["ai", "agents", "llm", "nlp", "language-model", "ai-agents"]
[project.optional-dependencies]
openai = ["httpx>=0.27.2", "openai>=1.59.8"]
replicate = ["replicate>=1.0.4"]
ollama = ["ollama>=0.4.6"]
grok = ["grok>=5.1", "httpx>=0.27.2"]
all = [
"groq>=0.15.0",
"httpx>=0.27.2",
"ollama>=0.4.6",
"openai>=1.59.8",
"replicate>=1.0.4",
]


[dependency-groups]
dev = [
"coverage>=7.6.10",
"groq>=0.15.0",
"httpx>=0.27.2",
"mypy>=1.14.1",
"ollama>=0.4.6",
"openai>=1.59.8",
"pytest>=8.3.4",
"replicate>=1.0.4",
"ruff>=0.9.2",
]
docs = [
"mkdocs>=1.6.1",
"mkdocs-material>=9.5.49",
"mkdocs-meta-descriptions-plugin>=3.0.0",
"mkdocstrings[python]>=0.27.0",
"python-dotenv>=1.0.1",
]


[project.urls]
Documentation = "https://igorbenav.github.io/clientai/"
Repository = "https://github.com/igorbenav/clientai/"
Issues = "https://github.com/igorbenav/clientai/issues"
# Changelog = ""

[tool.poetry.dependencies]
python = "^3.9"
httpx = ">=0.27.0,<0.28.0"
openai = {version = "^1.50.2", optional = true}
replicate = {version = "^0.34.1", optional = true}
ollama = {version = "^0.3.3", optional = true}
groq = {version = "^0.11.0", optional = true}
pydantic = "^2.10.3"

[tool.poetry.group.dev.dependencies]
ruff = "^0.6.8"
pytest = "^8.3.3"
mypy = "1.9.0"
openai = "^1.50.2"
replicate = "^0.34.1"
ollama = "^0.3.3"
groq = "^0.11.0"
httpx = ">=0.27.0,<0.28.0"
coverage = "^7.4.4"

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.1"
python-dotenv = "^1.0.1"
mkdocs-meta-descriptions-plugin = "^3.0.0"
mkdocs-material = "^9.5.48"
mkdocstrings = {extras = ["python"], version = "^0.27.0"}

[tool.poetry.extras]
minimal = []
openai = ["openai", "httpx"]
replicate = ["replicate"]
ollama = ["ollama"]
groq = ["groq", "httpx"]
all = ["openai", "replicate", "ollama", "groq", "httpx"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
target-version = "py312"
Expand Down Expand Up @@ -106,4 +117,14 @@ ignore = [
max-complexity = 24

[tool.ruff.lint.pydocstyle]
convention = "google"
convention = "google"

[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "src.app.*"
disallow_untyped_defs = true
Loading
Loading