mangaba 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mangaba-0.1.0/MANIFEST.in +4 -0
- mangaba-0.1.0/PKG-INFO +177 -0
- mangaba-0.1.0/README.md +157 -0
- mangaba-0.1.0/examples/basic_usage.py +57 -0
- mangaba-0.1.0/mangaba/__init__.py +57 -0
- mangaba-0.1.0/mangaba/cases/__init__.py +8 -0
- mangaba-0.1.0/mangaba/cases/cases.py +50 -0
- mangaba-0.1.0/mangaba/config/__init__.py +8 -0
- mangaba-0.1.0/mangaba/config/api.py +40 -0
- mangaba-0.1.0/mangaba/core/__init__.py +15 -0
- mangaba-0.1.0/mangaba/core/models.py +155 -0
- mangaba-0.1.0/mangaba.egg-info/PKG-INFO +177 -0
- mangaba-0.1.0/mangaba.egg-info/SOURCES.txt +17 -0
- mangaba-0.1.0/mangaba.egg-info/dependency_links.txt +1 -0
- mangaba-0.1.0/mangaba.egg-info/top_level.txt +1 -0
- mangaba-0.1.0/pyproject.toml +22 -0
- mangaba-0.1.0/requirements.txt +7 -0
- mangaba-0.1.0/setup.cfg +4 -0
- mangaba-0.1.0/setup.py +62 -0
mangaba-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mangaba
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Framework Python para criacao de equipes de agentes AI autonomos
|
|
5
|
+
Home-page: https://github.com/dheiver2/mangaba_ai
|
|
6
|
+
Author: Dheiver Santos
|
|
7
|
+
Author-email: Dheiver Santos <dheiver.santos@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/dheiver2/mangaba_ai
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/dheiver2/mangaba_ai/issues
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: home-page
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
|
|
21
|
+
# Mangaba - Framework de Automacao com Agentes Inteligentes
|
|
22
|
+
|
|
23
|
+
<img src="https://github.com/dheiver2/mangaba_ai/blob/main/img.png" width="300">
|
|
24
|
+
|
|
25
|
+
Framework Python para criacao de equipes de agentes AI autonomos que colaboram para resolver tarefas complexas.
|
|
26
|
+
|
|
27
|
+
## ✨ Funcionalidades Principais
|
|
28
|
+
|
|
29
|
+
- **Arquitetura Multi-Agente**: Crie equipes de agentes especializados
|
|
30
|
+
- **Memoria Contextual**: Historico individual e compartilhado entre agentes
|
|
31
|
+
- **Integracao Gemini**: Utilize os modelos mais avancados da Google
|
|
32
|
+
- **Ferramentas Externas**: Busca no Google e outras APIs
|
|
33
|
+
- **Gerenciamento de Tarefas**: Dependencias e priorizacao automatica
|
|
34
|
+
- **Processamento Assincrono**: Execucao paralela para maior eficiencia
|
|
35
|
+
|
|
36
|
+
## 🚀 Comecando
|
|
37
|
+
|
|
38
|
+
### Pre-requisitos
|
|
39
|
+
- Python 3.9+
|
|
40
|
+
- Conta no Google AI Studio (para API key do Gemini)
|
|
41
|
+
|
|
42
|
+
### Instalacao
|
|
43
|
+
|
|
44
|
+
**Metodo 1: Instalacao via pip (mais simples)**
|
|
45
|
+
```bash
|
|
46
|
+
pip install mangaba
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Metodo 2: Instalacao direta do repositorio com pre-instalacao**
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/dheiver2/mangaba_ai.git
|
|
52
|
+
cd mangaba_ai
|
|
53
|
+
# Execute o script de pre-instalacao das dependencias (recomendado)
|
|
54
|
+
python setup.py.pre
|
|
55
|
+
# Depois instale o pacote
|
|
56
|
+
pip install .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Metodo 3: Instalacao com requisitos em lote**
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/dheiver2/mangaba_ai.git
|
|
62
|
+
cd mangaba_ai
|
|
63
|
+
# Primeiro instale as dependencias
|
|
64
|
+
pip install -r requirements.txt
|
|
65
|
+
# Depois instale o pacote
|
|
66
|
+
pip install .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Verificacao da Instalacao
|
|
70
|
+
Para verificar se o Mangaba foi instalado corretamente, execute:
|
|
71
|
+
```python
|
|
72
|
+
import mangaba
|
|
73
|
+
print(mangaba.__version__) # Deve exibir a versao atual
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Solucao de problemas
|
|
77
|
+
|
|
78
|
+
1. Se encontrar erros sobre dependencias, instale-as manualmente:
|
|
79
|
+
```bash
|
|
80
|
+
pip install google-generativeai googlesearch-python requests aiohttp tenacity
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
2. Para ambiente Windows com problemas de codificacao:
|
|
84
|
+
```bash
|
|
85
|
+
set PYTHONIOENCODING=utf-8
|
|
86
|
+
pip install mangaba
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
3. Em caso de falha na instalacao em modo editavel:
|
|
90
|
+
```bash
|
|
91
|
+
python setup.py develop
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Configuracao
|
|
95
|
+
1. Obtenha sua API key do Gemini em https://ai.google.dev/
|
|
96
|
+
2. Configure a API em seu codigo:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import mangaba
|
|
100
|
+
from mangaba.config import configure_api
|
|
101
|
+
|
|
102
|
+
# Configure a API com sua chave
|
|
103
|
+
configure_api("sua_chave_aqui")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 📚 Exemplo de Uso
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
import asyncio
|
|
110
|
+
import mangaba
|
|
111
|
+
|
|
112
|
+
# Configure a API (veja secao de configuracao)
|
|
113
|
+
|
|
114
|
+
async def exemplo():
|
|
115
|
+
# Criacao dos agentes
|
|
116
|
+
memory = mangaba.ContextualMemory()
|
|
117
|
+
model = mangaba.GeminiModel()
|
|
118
|
+
search_tool = mangaba.GoogleSearchTool()
|
|
119
|
+
|
|
120
|
+
pesquisador = mangaba.Agent(
|
|
121
|
+
name="Pesquisador",
|
|
122
|
+
role="Busca dados",
|
|
123
|
+
model=model,
|
|
124
|
+
tools=[search_tool],
|
|
125
|
+
memory=memory
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Definicao de tarefas
|
|
129
|
+
tarefa = mangaba.Task(
|
|
130
|
+
description="Buscar inovacoes em IA",
|
|
131
|
+
agent=pesquisador
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Execucao
|
|
135
|
+
equipe = mangaba.Crew(agents=[pesquisador], tasks=[tarefa])
|
|
136
|
+
await equipe.run()
|
|
137
|
+
|
|
138
|
+
# Resultado
|
|
139
|
+
print(tarefa.result)
|
|
140
|
+
|
|
141
|
+
if __name__ == "__main__":
|
|
142
|
+
asyncio.run(exemplo())
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 🏗 Estrutura do Projeto
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
mangaba/
|
|
149
|
+
├── __init__.py # Exporta as classes principais
|
|
150
|
+
├── config/ # Modulo de configuracao
|
|
151
|
+
│ ├── __init__.py
|
|
152
|
+
│ └── api.py # Funcoes para configuracao da API
|
|
153
|
+
├── core/ # Modulo principal
|
|
154
|
+
│ ├── __init__.py
|
|
155
|
+
│ └── models.py # Definicoes das classes principais
|
|
156
|
+
└── cases/ # Casos de uso
|
|
157
|
+
├── __init__.py
|
|
158
|
+
└── cases.py # Exemplos prontos
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 🤝 Como Contribuir
|
|
162
|
+
|
|
163
|
+
1. Faca um fork do projeto
|
|
164
|
+
2. Crie sua branch (`git checkout -b feature/nova-funcionalidade`)
|
|
165
|
+
3. Commit suas mudancas (`git commit -m 'Adiciona nova funcionalidade'`)
|
|
166
|
+
4. Push para a branch (`git push origin feature/nova-funcionalidade`)
|
|
167
|
+
5. Abra um Pull Request
|
|
168
|
+
|
|
169
|
+
## 📄 Licenca
|
|
170
|
+
|
|
171
|
+
Distribuido sob licenca MIT. Veja `LICENSE` para mais informacoes.
|
|
172
|
+
|
|
173
|
+
## ✉️ Contato
|
|
174
|
+
|
|
175
|
+
Dheiver Santos - [@dheiver](https://github.com/dheiver2) - dheiver.santos@gmail.com
|
|
176
|
+
|
|
177
|
+
Project Link: [https://github.com/dheiver2/mangaba_ai](https://github.com/dheiver2/mangaba_ai)
|
mangaba-0.1.0/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Mangaba - Framework de Automacao com Agentes Inteligentes
|
|
2
|
+
|
|
3
|
+
<img src="https://github.com/dheiver2/mangaba_ai/blob/main/img.png" width="300">
|
|
4
|
+
|
|
5
|
+
Framework Python para criacao de equipes de agentes AI autonomos que colaboram para resolver tarefas complexas.
|
|
6
|
+
|
|
7
|
+
## ✨ Funcionalidades Principais
|
|
8
|
+
|
|
9
|
+
- **Arquitetura Multi-Agente**: Crie equipes de agentes especializados
|
|
10
|
+
- **Memoria Contextual**: Historico individual e compartilhado entre agentes
|
|
11
|
+
- **Integracao Gemini**: Utilize os modelos mais avancados da Google
|
|
12
|
+
- **Ferramentas Externas**: Busca no Google e outras APIs
|
|
13
|
+
- **Gerenciamento de Tarefas**: Dependencias e priorizacao automatica
|
|
14
|
+
- **Processamento Assincrono**: Execucao paralela para maior eficiencia
|
|
15
|
+
|
|
16
|
+
## 🚀 Comecando
|
|
17
|
+
|
|
18
|
+
### Pre-requisitos
|
|
19
|
+
- Python 3.9+
|
|
20
|
+
- Conta no Google AI Studio (para API key do Gemini)
|
|
21
|
+
|
|
22
|
+
### Instalacao
|
|
23
|
+
|
|
24
|
+
**Metodo 1: Instalacao via pip (mais simples)**
|
|
25
|
+
```bash
|
|
26
|
+
pip install mangaba
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Metodo 2: Instalacao direta do repositorio com pre-instalacao**
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/dheiver2/mangaba_ai.git
|
|
32
|
+
cd mangaba_ai
|
|
33
|
+
# Execute o script de pre-instalacao das dependencias (recomendado)
|
|
34
|
+
python setup.py.pre
|
|
35
|
+
# Depois instale o pacote
|
|
36
|
+
pip install .
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Metodo 3: Instalacao com requisitos em lote**
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/dheiver2/mangaba_ai.git
|
|
42
|
+
cd mangaba_ai
|
|
43
|
+
# Primeiro instale as dependencias
|
|
44
|
+
pip install -r requirements.txt
|
|
45
|
+
# Depois instale o pacote
|
|
46
|
+
pip install .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Verificacao da Instalacao
|
|
50
|
+
Para verificar se o Mangaba foi instalado corretamente, execute:
|
|
51
|
+
```python
|
|
52
|
+
import mangaba
|
|
53
|
+
print(mangaba.__version__) # Deve exibir a versao atual
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Solucao de problemas
|
|
57
|
+
|
|
58
|
+
1. Se encontrar erros sobre dependencias, instale-as manualmente:
|
|
59
|
+
```bash
|
|
60
|
+
pip install google-generativeai googlesearch-python requests aiohttp tenacity
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
2. Para ambiente Windows com problemas de codificacao:
|
|
64
|
+
```bash
|
|
65
|
+
set PYTHONIOENCODING=utf-8
|
|
66
|
+
pip install mangaba
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
3. Em caso de falha na instalacao em modo editavel:
|
|
70
|
+
```bash
|
|
71
|
+
python setup.py develop
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Configuracao
|
|
75
|
+
1. Obtenha sua API key do Gemini em https://ai.google.dev/
|
|
76
|
+
2. Configure a API em seu codigo:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import mangaba
|
|
80
|
+
from mangaba.config import configure_api
|
|
81
|
+
|
|
82
|
+
# Configure a API com sua chave
|
|
83
|
+
configure_api("sua_chave_aqui")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 📚 Exemplo de Uso
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import asyncio
|
|
90
|
+
import mangaba
|
|
91
|
+
|
|
92
|
+
# Configure a API (veja secao de configuracao)
|
|
93
|
+
|
|
94
|
+
async def exemplo():
|
|
95
|
+
# Criacao dos agentes
|
|
96
|
+
memory = mangaba.ContextualMemory()
|
|
97
|
+
model = mangaba.GeminiModel()
|
|
98
|
+
search_tool = mangaba.GoogleSearchTool()
|
|
99
|
+
|
|
100
|
+
pesquisador = mangaba.Agent(
|
|
101
|
+
name="Pesquisador",
|
|
102
|
+
role="Busca dados",
|
|
103
|
+
model=model,
|
|
104
|
+
tools=[search_tool],
|
|
105
|
+
memory=memory
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# Definicao de tarefas
|
|
109
|
+
tarefa = mangaba.Task(
|
|
110
|
+
description="Buscar inovacoes em IA",
|
|
111
|
+
agent=pesquisador
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# Execucao
|
|
115
|
+
equipe = mangaba.Crew(agents=[pesquisador], tasks=[tarefa])
|
|
116
|
+
await equipe.run()
|
|
117
|
+
|
|
118
|
+
# Resultado
|
|
119
|
+
print(tarefa.result)
|
|
120
|
+
|
|
121
|
+
if __name__ == "__main__":
|
|
122
|
+
asyncio.run(exemplo())
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 🏗 Estrutura do Projeto
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
mangaba/
|
|
129
|
+
├── __init__.py # Exporta as classes principais
|
|
130
|
+
├── config/ # Modulo de configuracao
|
|
131
|
+
│ ├── __init__.py
|
|
132
|
+
│ └── api.py # Funcoes para configuracao da API
|
|
133
|
+
├── core/ # Modulo principal
|
|
134
|
+
│ ├── __init__.py
|
|
135
|
+
│ └── models.py # Definicoes das classes principais
|
|
136
|
+
└── cases/ # Casos de uso
|
|
137
|
+
├── __init__.py
|
|
138
|
+
└── cases.py # Exemplos prontos
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 🤝 Como Contribuir
|
|
142
|
+
|
|
143
|
+
1. Faca um fork do projeto
|
|
144
|
+
2. Crie sua branch (`git checkout -b feature/nova-funcionalidade`)
|
|
145
|
+
3. Commit suas mudancas (`git commit -m 'Adiciona nova funcionalidade'`)
|
|
146
|
+
4. Push para a branch (`git push origin feature/nova-funcionalidade`)
|
|
147
|
+
5. Abra um Pull Request
|
|
148
|
+
|
|
149
|
+
## 📄 Licenca
|
|
150
|
+
|
|
151
|
+
Distribuido sob licenca MIT. Veja `LICENSE` para mais informacoes.
|
|
152
|
+
|
|
153
|
+
## ✉️ Contato
|
|
154
|
+
|
|
155
|
+
Dheiver Santos - [@dheiver](https://github.com/dheiver2) - dheiver.santos@gmail.com
|
|
156
|
+
|
|
157
|
+
Project Link: [https://github.com/dheiver2/mangaba_ai](https://github.com/dheiver2/mangaba_ai)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Exemplo basico de uso do pacote Mangaba.
|
|
6
|
+
|
|
7
|
+
Este script demonstra como configurar e usar o Mangaba para criar
|
|
8
|
+
uma equipe simples de agentes.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import asyncio
|
|
12
|
+
import os
|
|
13
|
+
|
|
14
|
+
# Importando o pacote principal
|
|
15
|
+
import mangaba
|
|
16
|
+
from mangaba.config import configure_api
|
|
17
|
+
|
|
18
|
+
# Definir sua chave API do Gemini (obtenha em https://ai.google.dev/)
|
|
19
|
+
API_KEY = os.environ.get("GEMINI_API_KEY", "")
|
|
20
|
+
if not API_KEY:
|
|
21
|
+
API_KEY = input("Digite sua chave de API do Gemini: ")
|
|
22
|
+
|
|
23
|
+
# Configurar a API
|
|
24
|
+
configure_api(API_KEY)
|
|
25
|
+
|
|
26
|
+
async def simple_example():
|
|
27
|
+
"""Exemplo simples de uso com um unico agente"""
|
|
28
|
+
# Criacao dos componentes basicos
|
|
29
|
+
memory = mangaba.ContextualMemory()
|
|
30
|
+
model = mangaba.GeminiModel()
|
|
31
|
+
search_tool = mangaba.GoogleSearchTool()
|
|
32
|
+
|
|
33
|
+
# Criacao do agente
|
|
34
|
+
pesquisador = mangaba.Agent(
|
|
35
|
+
name="Pesquisador",
|
|
36
|
+
role="Encontra informacoes",
|
|
37
|
+
model=model,
|
|
38
|
+
tools=[search_tool],
|
|
39
|
+
memory=memory
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Definicao da tarefa
|
|
43
|
+
tarefa = mangaba.Task(
|
|
44
|
+
description="Quais sao as tendencias tecnologicas para 2025?",
|
|
45
|
+
agent=pesquisador
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Execucao
|
|
49
|
+
equipe = mangaba.Crew(agents=[pesquisador], tasks=[tarefa])
|
|
50
|
+
await equipe.run()
|
|
51
|
+
|
|
52
|
+
# Resultado
|
|
53
|
+
print("\nResultado final:")
|
|
54
|
+
print(tarefa.result)
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
asyncio.run(simple_example())
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Mangaba - Framework de Automacao com Agentes Inteligentes
|
|
4
|
+
|
|
5
|
+
Um framework Python para criacao de equipes de agentes AI autonomos
|
|
6
|
+
que colaboram para resolver tarefas complexas.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.0"
|
|
10
|
+
|
|
11
|
+
# Verificacao e instalacao automatica de dependencias
|
|
12
|
+
import importlib.util
|
|
13
|
+
import subprocess
|
|
14
|
+
import sys
|
|
15
|
+
import warnings
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _check_and_install_dependency(package_name, pip_name=None):
|
|
19
|
+
"""Verifica se um pacote esta instalado e o instala se necessario."""
|
|
20
|
+
if pip_name is None:
|
|
21
|
+
pip_name = package_name
|
|
22
|
+
|
|
23
|
+
if importlib.util.find_spec(package_name) is None:
|
|
24
|
+
warnings.warn(
|
|
25
|
+
f"Dependencia '{package_name}' nao encontrada. Instalando automaticamente...",
|
|
26
|
+
ImportWarning
|
|
27
|
+
)
|
|
28
|
+
try:
|
|
29
|
+
subprocess.check_call(
|
|
30
|
+
[sys.executable, "-m", "pip", "install", pip_name],
|
|
31
|
+
stdout=subprocess.DEVNULL,
|
|
32
|
+
stderr=subprocess.DEVNULL
|
|
33
|
+
)
|
|
34
|
+
print(f"[+] {package_name} instalado com sucesso!")
|
|
35
|
+
except subprocess.CalledProcessError:
|
|
36
|
+
raise ImportError(
|
|
37
|
+
f"Nao foi possivel instalar '{pip_name}' automaticamente. "
|
|
38
|
+
f"Por favor, instale manualmente com 'pip install {pip_name}'"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# Verificacao de dependencias principais
|
|
43
|
+
_check_and_install_dependency("google", "google-generativeai>=0.8.3")
|
|
44
|
+
_check_and_install_dependency("googlesearch", "googlesearch-python>=1.2.1")
|
|
45
|
+
_check_and_install_dependency("requests", "requests>=2.32.3")
|
|
46
|
+
_check_and_install_dependency("aiohttp", "aiohttp>=3.10.5")
|
|
47
|
+
_check_and_install_dependency("tenacity", "tenacity>=8.5.0")
|
|
48
|
+
|
|
49
|
+
# Importa as classes principais para facilitar o acesso direto
|
|
50
|
+
from mangaba.core.models import (
|
|
51
|
+
ContextualMemory,
|
|
52
|
+
GeminiModel,
|
|
53
|
+
GoogleSearchTool,
|
|
54
|
+
Agent,
|
|
55
|
+
Task,
|
|
56
|
+
Crew
|
|
57
|
+
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# mangaba/cases/cases.py
|
|
3
|
+
# Casos de uso do Mangaba
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from mangaba.core.models import ContextualMemory, GeminiModel, GoogleSearchTool, Agent, Task, Crew
|
|
7
|
+
|
|
8
|
+
# Case de Uso 1: Analise de Tendencias de Mercado
|
|
9
|
+
async def case_mercado():
|
|
10
|
+
print("\n=== Case 1: Analise de Tendencias de Mercado ===")
|
|
11
|
+
memory = ContextualMemory(max_context_size=5)
|
|
12
|
+
model = GeminiModel(temperature=0.8, top_k=50)
|
|
13
|
+
search_tool = GoogleSearchTool()
|
|
14
|
+
|
|
15
|
+
pesquisador = Agent(name="Pesquisador", role="Busca dados", model=model, tools=[search_tool], memory=memory)
|
|
16
|
+
analista = Agent(name="Analista", role="Analisa dados", model=model, memory=memory)
|
|
17
|
+
escritor = Agent(name="Escritor", role="Escreve relatorio", model=model, memory=memory)
|
|
18
|
+
|
|
19
|
+
tarefa_pesquisa = Task(description="Buscar dados sobre tendencias em tecnologias verdes em 2025", agent=pesquisador, priority=2)
|
|
20
|
+
tarefa_analise = Task(description="Analisar os dados encontrados", agent=analista, priority=1, dependencies=[tarefa_pesquisa])
|
|
21
|
+
tarefa_relatorio = Task(description="Gerar relatorio executivo", agent=escritor, priority=0, dependencies=[tarefa_analise])
|
|
22
|
+
|
|
23
|
+
equipe = Crew(agents=[pesquisador, analista, escritor], tasks=[tarefa_pesquisa, tarefa_analise, tarefa_relatorio])
|
|
24
|
+
await equipe.run()
|
|
25
|
+
|
|
26
|
+
# Case de Uso 2: Planejamento Educacional
|
|
27
|
+
async def case_educacao():
|
|
28
|
+
print("\n=== Case 2: Planejamento Educacional ===")
|
|
29
|
+
memory = ContextualMemory(max_context_size=5)
|
|
30
|
+
model = GeminiModel(temperature=0.8, top_k=50)
|
|
31
|
+
search_tool = GoogleSearchTool()
|
|
32
|
+
|
|
33
|
+
pesquisador = Agent(name="Pesquisador", role="Busca dados", model=model, tools=[search_tool], memory=memory)
|
|
34
|
+
analista = Agent(name="Analista", role="Analisa dados", model=model, memory=memory)
|
|
35
|
+
escritor = Agent(name="Escritor", role="Escreve relatorio", model=model, memory=memory)
|
|
36
|
+
|
|
37
|
+
tarefa_pesquisa = Task(description="Buscar dados sobre IA na educacao em 2025", agent=pesquisador, priority=2)
|
|
38
|
+
tarefa_analise = Task(description="Analisar os dados encontrados", agent=analista, priority=1, dependencies=[tarefa_pesquisa])
|
|
39
|
+
tarefa_relatorio = Task(description="Gerar relatorio executivo", agent=escritor, priority=0, dependencies=[tarefa_analise])
|
|
40
|
+
|
|
41
|
+
equipe = Crew(agents=[pesquisador, analista, escritor], tasks=[tarefa_pesquisa, tarefa_analise, tarefa_relatorio])
|
|
42
|
+
await equipe.run()
|
|
43
|
+
|
|
44
|
+
# Funcao principal para execucao
|
|
45
|
+
async def main():
|
|
46
|
+
await case_mercado()
|
|
47
|
+
await case_educacao()
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
asyncio.run(main()) # Usa asyncio.run para execucao fora do Colab; no Colab, use await main()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# mangaba/config/api.py
|
|
3
|
+
# Configuracao da API do Gemini para uso fora do Google Colab
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
import google.generativeai as genai
|
|
7
|
+
except ImportError:
|
|
8
|
+
raise ImportError(
|
|
9
|
+
"O pacote 'google-generativeai' nao esta instalado. "
|
|
10
|
+
"Execute 'pip install google-generativeai' para instala-lo."
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
def configure_api(api_key: str):
|
|
14
|
+
"""
|
|
15
|
+
Configura a API do Gemini com a chave fornecida.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
api_key (str): Chave de API do Gemini
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
bool: True se a configuracao foi bem-sucedida
|
|
22
|
+
|
|
23
|
+
Raises:
|
|
24
|
+
ValueError: Se a chave de API for invalida
|
|
25
|
+
"""
|
|
26
|
+
if not api_key:
|
|
27
|
+
raise ValueError(
|
|
28
|
+
"A chave da API nao pode estar vazia. "
|
|
29
|
+
"Obtenha uma chave em: https://ai.google.dev/"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
try:
|
|
33
|
+
genai.configure(api_key=api_key)
|
|
34
|
+
# Teste simples para verificar a API
|
|
35
|
+
test_model = genai.GenerativeModel("gemini-1.5-flash")
|
|
36
|
+
test_response = test_model.generate_content("Teste de API")
|
|
37
|
+
print("API do Gemini configurada com sucesso!")
|
|
38
|
+
return True
|
|
39
|
+
except Exception as e:
|
|
40
|
+
raise ValueError(f"Falha ao configurar a API do Gemini: {str(e)}")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Modulo core do Mangaba.
|
|
4
|
+
|
|
5
|
+
Contem as implementacoes das classes principais do framework.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from mangaba.core.models import (
|
|
9
|
+
ContextualMemory,
|
|
10
|
+
GeminiModel,
|
|
11
|
+
GoogleSearchTool,
|
|
12
|
+
Agent,
|
|
13
|
+
Task,
|
|
14
|
+
Crew
|
|
15
|
+
)
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# mangaba/core/models.py
|
|
3
|
+
# Definicoes das classes principais do Mangaba
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from typing import List, Optional, Dict
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import google.generativeai as genai
|
|
11
|
+
except ImportError:
|
|
12
|
+
raise ImportError(
|
|
13
|
+
"O pacote 'google-generativeai' nao esta instalado. "
|
|
14
|
+
"Execute 'pip install google-generativeai' para instala-lo."
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
from googlesearch import search
|
|
19
|
+
except ImportError:
|
|
20
|
+
raise ImportError(
|
|
21
|
+
"O pacote 'googlesearch-python' nao esta instalado. "
|
|
22
|
+
"Execute 'pip install googlesearch-python' para instala-lo."
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# ContextualMemory (com memoria global)
|
|
26
|
+
class ContextualMemory:
|
|
27
|
+
def __init__(self, max_context_size: int = 10):
|
|
28
|
+
self.individual_data: Dict[str, List[str]] = {}
|
|
29
|
+
self.global_data: List[str] = []
|
|
30
|
+
self.max_context_size = max_context_size
|
|
31
|
+
|
|
32
|
+
def store_individual(self, agent_name: str, content: str):
|
|
33
|
+
agent_history = self.individual_data.setdefault(agent_name, [])
|
|
34
|
+
agent_history.append(content)
|
|
35
|
+
if len(agent_history) > self.max_context_size:
|
|
36
|
+
agent_history.pop(0)
|
|
37
|
+
|
|
38
|
+
def store_global(self, content: str):
|
|
39
|
+
self.global_data.append(content)
|
|
40
|
+
if len(self.global_data) > self.max_context_size:
|
|
41
|
+
self.global_data.pop(0)
|
|
42
|
+
|
|
43
|
+
def retrieve_individual(self, agent_name: str) -> List[str]:
|
|
44
|
+
return self.individual_data.get(agent_name, [])
|
|
45
|
+
|
|
46
|
+
def retrieve_global(self) -> List[str]:
|
|
47
|
+
return self.global_data
|
|
48
|
+
|
|
49
|
+
# GeminiModel (com tratamento de erro)
|
|
50
|
+
class GeminiModel:
|
|
51
|
+
def __init__(self, model_name: str = "gemini-1.5-flash", temperature: float = 0.7, top_k: int = 40):
|
|
52
|
+
self.model = genai.GenerativeModel(model_name)
|
|
53
|
+
self.temperature = temperature
|
|
54
|
+
self.top_k = top_k
|
|
55
|
+
|
|
56
|
+
async def generate(self, prompt: str) -> str:
|
|
57
|
+
try:
|
|
58
|
+
await asyncio.sleep(0.5) # Simula latencia
|
|
59
|
+
response = self.model.generate_content(
|
|
60
|
+
prompt,
|
|
61
|
+
generation_config=genai.types.GenerationConfig(
|
|
62
|
+
temperature=self.temperature,
|
|
63
|
+
top_k=self.top_k
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
return response.text
|
|
67
|
+
except Exception as e:
|
|
68
|
+
return f"Erro na geracao: {str(e)}"
|
|
69
|
+
|
|
70
|
+
# GoogleSearchTool (busca real)
|
|
71
|
+
class GoogleSearchTool:
|
|
72
|
+
async def run(self, query: str) -> str:
|
|
73
|
+
await asyncio.sleep(0.3) # Simula latencia de rede
|
|
74
|
+
try:
|
|
75
|
+
results = list(search(query, num_results=3))
|
|
76
|
+
return f"Resultados da busca: {', '.join(results)}"
|
|
77
|
+
except Exception as e:
|
|
78
|
+
return f"Erro na busca: {str(e)}"
|
|
79
|
+
|
|
80
|
+
# Agent
|
|
81
|
+
class Agent:
|
|
82
|
+
def __init__(self, name: str, role: str, model, tools: Optional[List] = None, memory=None):
|
|
83
|
+
self.name = name
|
|
84
|
+
self.role = role
|
|
85
|
+
self.model = model
|
|
86
|
+
self.tools = tools or []
|
|
87
|
+
self.memory = memory
|
|
88
|
+
|
|
89
|
+
async def execute(self, input_text: str, dependencies: List[str] = None) -> str:
|
|
90
|
+
print(f"[{self.name}] Executando: {input_text}")
|
|
91
|
+
|
|
92
|
+
individual_context = self.memory.retrieve_individual(self.name) if self.memory else []
|
|
93
|
+
global_context = self.memory.retrieve_global() if self.memory else []
|
|
94
|
+
deps_text = f"Dependencias: {dependencies}" if dependencies else ""
|
|
95
|
+
enriched_input = (
|
|
96
|
+
f"Contexto individual: {individual_context[-3:]}\n"
|
|
97
|
+
f"Contexto global: {global_context[-3:]}\n"
|
|
98
|
+
f"{deps_text}\nTarefa: {input_text}"
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
tool_outputs = []
|
|
102
|
+
for tool in self.tools:
|
|
103
|
+
tool_result = await tool.run(input_text)
|
|
104
|
+
tool_outputs.append(f"[{tool.__class__.__name__}] {tool_result}")
|
|
105
|
+
|
|
106
|
+
final_input = f"{enriched_input}\nResultados das ferramentas: {tool_outputs}" if tool_outputs else enriched_input
|
|
107
|
+
|
|
108
|
+
response = await self.model.generate(final_input)
|
|
109
|
+
|
|
110
|
+
if len(response) < 50:
|
|
111
|
+
response = await self.model.generate(f"{final_input}\nPor favor, forneca mais detalhes.")
|
|
112
|
+
|
|
113
|
+
if self.memory:
|
|
114
|
+
self.memory.store_individual(self.name, f"Entrada: {input_text}\nResposta: {response}")
|
|
115
|
+
self.memory.store_global(f"[{self.name}] {response}")
|
|
116
|
+
|
|
117
|
+
return response
|
|
118
|
+
|
|
119
|
+
# Task
|
|
120
|
+
@dataclass
|
|
121
|
+
class Task:
|
|
122
|
+
description: str
|
|
123
|
+
agent: "Agent"
|
|
124
|
+
priority: int = 0
|
|
125
|
+
dependencies: Optional[List["Task"]] = None
|
|
126
|
+
result: Optional[str] = None
|
|
127
|
+
executed: bool = False # Controle para evitar reexecucao
|
|
128
|
+
|
|
129
|
+
def get_dependencies_results(self) -> List[str]:
|
|
130
|
+
if not self.dependencies:
|
|
131
|
+
return []
|
|
132
|
+
return [task.result for task in self.dependencies if task.result]
|
|
133
|
+
|
|
134
|
+
# Crew (com controle de execucao)
|
|
135
|
+
class Crew:
|
|
136
|
+
def __init__(self, agents: List[Agent], tasks: List[Task]):
|
|
137
|
+
self.agents = {agent.name: agent for agent in agents}
|
|
138
|
+
self.tasks = sorted(tasks, key=lambda t: t.priority, reverse=True)
|
|
139
|
+
|
|
140
|
+
async def run_task(self, task: Task):
|
|
141
|
+
if task.executed: # Evita executar a mesma tarefa mais de uma vez
|
|
142
|
+
return
|
|
143
|
+
|
|
144
|
+
if task.dependencies:
|
|
145
|
+
await asyncio.gather(*(self.run_task(dep) for dep in task.dependencies if not dep.executed))
|
|
146
|
+
|
|
147
|
+
agent = self.agents[task.agent.name]
|
|
148
|
+
dependencies_results = task.get_dependencies_results()
|
|
149
|
+
result = await agent.execute(task.description, dependencies_results)
|
|
150
|
+
task.result = result
|
|
151
|
+
task.executed = True # Marca como executada
|
|
152
|
+
print(f"[{agent.name}] Resultado: {result}")
|
|
153
|
+
|
|
154
|
+
async def run(self):
|
|
155
|
+
await asyncio.gather(*(self.run_task(task) for task in self.tasks))
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mangaba
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Framework Python para criacao de equipes de agentes AI autonomos
|
|
5
|
+
Home-page: https://github.com/dheiver2/mangaba_ai
|
|
6
|
+
Author: Dheiver Santos
|
|
7
|
+
Author-email: Dheiver Santos <dheiver.santos@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/dheiver2/mangaba_ai
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/dheiver2/mangaba_ai/issues
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: home-page
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
|
|
21
|
+
# Mangaba - Framework de Automacao com Agentes Inteligentes
|
|
22
|
+
|
|
23
|
+
<img src="https://github.com/dheiver2/mangaba_ai/blob/main/img.png" width="300">
|
|
24
|
+
|
|
25
|
+
Framework Python para criacao de equipes de agentes AI autonomos que colaboram para resolver tarefas complexas.
|
|
26
|
+
|
|
27
|
+
## ✨ Funcionalidades Principais
|
|
28
|
+
|
|
29
|
+
- **Arquitetura Multi-Agente**: Crie equipes de agentes especializados
|
|
30
|
+
- **Memoria Contextual**: Historico individual e compartilhado entre agentes
|
|
31
|
+
- **Integracao Gemini**: Utilize os modelos mais avancados da Google
|
|
32
|
+
- **Ferramentas Externas**: Busca no Google e outras APIs
|
|
33
|
+
- **Gerenciamento de Tarefas**: Dependencias e priorizacao automatica
|
|
34
|
+
- **Processamento Assincrono**: Execucao paralela para maior eficiencia
|
|
35
|
+
|
|
36
|
+
## 🚀 Comecando
|
|
37
|
+
|
|
38
|
+
### Pre-requisitos
|
|
39
|
+
- Python 3.9+
|
|
40
|
+
- Conta no Google AI Studio (para API key do Gemini)
|
|
41
|
+
|
|
42
|
+
### Instalacao
|
|
43
|
+
|
|
44
|
+
**Metodo 1: Instalacao via pip (mais simples)**
|
|
45
|
+
```bash
|
|
46
|
+
pip install mangaba
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Metodo 2: Instalacao direta do repositorio com pre-instalacao**
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/dheiver2/mangaba_ai.git
|
|
52
|
+
cd mangaba_ai
|
|
53
|
+
# Execute o script de pre-instalacao das dependencias (recomendado)
|
|
54
|
+
python setup.py.pre
|
|
55
|
+
# Depois instale o pacote
|
|
56
|
+
pip install .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Metodo 3: Instalacao com requisitos em lote**
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/dheiver2/mangaba_ai.git
|
|
62
|
+
cd mangaba_ai
|
|
63
|
+
# Primeiro instale as dependencias
|
|
64
|
+
pip install -r requirements.txt
|
|
65
|
+
# Depois instale o pacote
|
|
66
|
+
pip install .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Verificacao da Instalacao
|
|
70
|
+
Para verificar se o Mangaba foi instalado corretamente, execute:
|
|
71
|
+
```python
|
|
72
|
+
import mangaba
|
|
73
|
+
print(mangaba.__version__) # Deve exibir a versao atual
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Solucao de problemas
|
|
77
|
+
|
|
78
|
+
1. Se encontrar erros sobre dependencias, instale-as manualmente:
|
|
79
|
+
```bash
|
|
80
|
+
pip install google-generativeai googlesearch-python requests aiohttp tenacity
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
2. Para ambiente Windows com problemas de codificacao:
|
|
84
|
+
```bash
|
|
85
|
+
set PYTHONIOENCODING=utf-8
|
|
86
|
+
pip install mangaba
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
3. Em caso de falha na instalacao em modo editavel:
|
|
90
|
+
```bash
|
|
91
|
+
python setup.py develop
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Configuracao
|
|
95
|
+
1. Obtenha sua API key do Gemini em https://ai.google.dev/
|
|
96
|
+
2. Configure a API em seu codigo:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import mangaba
|
|
100
|
+
from mangaba.config import configure_api
|
|
101
|
+
|
|
102
|
+
# Configure a API com sua chave
|
|
103
|
+
configure_api("sua_chave_aqui")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 📚 Exemplo de Uso
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
import asyncio
|
|
110
|
+
import mangaba
|
|
111
|
+
|
|
112
|
+
# Configure a API (veja secao de configuracao)
|
|
113
|
+
|
|
114
|
+
async def exemplo():
|
|
115
|
+
# Criacao dos agentes
|
|
116
|
+
memory = mangaba.ContextualMemory()
|
|
117
|
+
model = mangaba.GeminiModel()
|
|
118
|
+
search_tool = mangaba.GoogleSearchTool()
|
|
119
|
+
|
|
120
|
+
pesquisador = mangaba.Agent(
|
|
121
|
+
name="Pesquisador",
|
|
122
|
+
role="Busca dados",
|
|
123
|
+
model=model,
|
|
124
|
+
tools=[search_tool],
|
|
125
|
+
memory=memory
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Definicao de tarefas
|
|
129
|
+
tarefa = mangaba.Task(
|
|
130
|
+
description="Buscar inovacoes em IA",
|
|
131
|
+
agent=pesquisador
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Execucao
|
|
135
|
+
equipe = mangaba.Crew(agents=[pesquisador], tasks=[tarefa])
|
|
136
|
+
await equipe.run()
|
|
137
|
+
|
|
138
|
+
# Resultado
|
|
139
|
+
print(tarefa.result)
|
|
140
|
+
|
|
141
|
+
if __name__ == "__main__":
|
|
142
|
+
asyncio.run(exemplo())
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 🏗 Estrutura do Projeto
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
mangaba/
|
|
149
|
+
├── __init__.py # Exporta as classes principais
|
|
150
|
+
├── config/ # Modulo de configuracao
|
|
151
|
+
│ ├── __init__.py
|
|
152
|
+
│ └── api.py # Funcoes para configuracao da API
|
|
153
|
+
├── core/ # Modulo principal
|
|
154
|
+
│ ├── __init__.py
|
|
155
|
+
│ └── models.py # Definicoes das classes principais
|
|
156
|
+
└── cases/ # Casos de uso
|
|
157
|
+
├── __init__.py
|
|
158
|
+
└── cases.py # Exemplos prontos
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 🤝 Como Contribuir
|
|
162
|
+
|
|
163
|
+
1. Faca um fork do projeto
|
|
164
|
+
2. Crie sua branch (`git checkout -b feature/nova-funcionalidade`)
|
|
165
|
+
3. Commit suas mudancas (`git commit -m 'Adiciona nova funcionalidade'`)
|
|
166
|
+
4. Push para a branch (`git push origin feature/nova-funcionalidade`)
|
|
167
|
+
5. Abra um Pull Request
|
|
168
|
+
|
|
169
|
+
## 📄 Licenca
|
|
170
|
+
|
|
171
|
+
Distribuido sob licenca MIT. Veja `LICENSE` para mais informacoes.
|
|
172
|
+
|
|
173
|
+
## ✉️ Contato
|
|
174
|
+
|
|
175
|
+
Dheiver Santos - [@dheiver](https://github.com/dheiver2) - dheiver.santos@gmail.com
|
|
176
|
+
|
|
177
|
+
Project Link: [https://github.com/dheiver2/mangaba_ai](https://github.com/dheiver2/mangaba_ai)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
requirements.txt
|
|
5
|
+
setup.py
|
|
6
|
+
examples/basic_usage.py
|
|
7
|
+
mangaba/__init__.py
|
|
8
|
+
mangaba.egg-info/PKG-INFO
|
|
9
|
+
mangaba.egg-info/SOURCES.txt
|
|
10
|
+
mangaba.egg-info/dependency_links.txt
|
|
11
|
+
mangaba.egg-info/top_level.txt
|
|
12
|
+
mangaba/cases/__init__.py
|
|
13
|
+
mangaba/cases/cases.py
|
|
14
|
+
mangaba/config/__init__.py
|
|
15
|
+
mangaba/config/api.py
|
|
16
|
+
mangaba/core/__init__.py
|
|
17
|
+
mangaba/core/models.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mangaba
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mangaba"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Framework Python para criacao de equipes de agentes AI autonomos"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [{name = "Dheiver Santos", email = "dheiver.santos@gmail.com"}]
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.9",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
]
|
|
18
|
+
requires-python = ">=3.9"
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
"Homepage" = "https://github.com/dheiver2/mangaba_ai"
|
|
22
|
+
"Bug Tracker" = "https://github.com/dheiver2/mangaba_ai/issues"
|
mangaba-0.1.0/setup.cfg
ADDED
mangaba-0.1.0/setup.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from setuptools import setup, find_packages
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
# Garantir que as dependencias basicas de build estejam instaladas
|
|
7
|
+
try:
|
|
8
|
+
import pip
|
|
9
|
+
print("[-] pip esta instalado")
|
|
10
|
+
except ImportError:
|
|
11
|
+
print("[!] pip nao esta instalado corretamente")
|
|
12
|
+
|
|
13
|
+
# Instalando dependencias antes da build
|
|
14
|
+
DEPENDENCIES = [
|
|
15
|
+
"google-generativeai>=0.8.3",
|
|
16
|
+
"googlesearch-python>=1.2.1",
|
|
17
|
+
"requests>=2.32.3",
|
|
18
|
+
"aiohttp>=3.10.5",
|
|
19
|
+
"tenacity>=8.5.0",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
print("[+] Instalando dependencias necessarias para a build...")
|
|
23
|
+
for dep in DEPENDENCIES:
|
|
24
|
+
try:
|
|
25
|
+
subprocess.check_call(
|
|
26
|
+
[sys.executable, "-m", "pip", "install", dep],
|
|
27
|
+
stdout=subprocess.DEVNULL,
|
|
28
|
+
stderr=subprocess.DEVNULL
|
|
29
|
+
)
|
|
30
|
+
print(f" [+] {dep}")
|
|
31
|
+
except subprocess.CalledProcessError:
|
|
32
|
+
print(f" [!] Falha ao instalar {dep}")
|
|
33
|
+
|
|
34
|
+
# Carrega o README para a descricao longa
|
|
35
|
+
with open("README.md", "r", encoding="utf-8") as fh:
|
|
36
|
+
long_description = fh.read()
|
|
37
|
+
|
|
38
|
+
setup(
|
|
39
|
+
name="mangaba",
|
|
40
|
+
version="0.1.0",
|
|
41
|
+
description="Framework Python para criacao de equipes de agentes AI autonomos",
|
|
42
|
+
long_description=long_description,
|
|
43
|
+
long_description_content_type="text/markdown",
|
|
44
|
+
author="Dheiver Santos",
|
|
45
|
+
author_email="dheiver.santos@gmail.com",
|
|
46
|
+
url="https://github.com/dheiver2/mangaba_ai",
|
|
47
|
+
packages=find_packages(),
|
|
48
|
+
install_requires=DEPENDENCIES,
|
|
49
|
+
setup_requires=["wheel"],
|
|
50
|
+
classifiers=[
|
|
51
|
+
"Programming Language :: Python :: 3",
|
|
52
|
+
"Programming Language :: Python :: 3.9",
|
|
53
|
+
"Programming Language :: Python :: 3.10",
|
|
54
|
+
"License :: OSI Approved :: MIT License",
|
|
55
|
+
"Operating System :: OS Independent",
|
|
56
|
+
"Development Status :: 3 - Alpha",
|
|
57
|
+
"Intended Audience :: Developers",
|
|
58
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
59
|
+
],
|
|
60
|
+
python_requires=">=3.9",
|
|
61
|
+
keywords="ai, agents, llm, gemini, autonomous",
|
|
62
|
+
)
|