Skip to content

Commit

Permalink
Merge pull request #71 from filip-michalsky/improve_readme
Browse files Browse the repository at this point in the history
 Improve readme + resolve openai dependency 1.00+ breaking changes
  • Loading branch information
filip-michalsky authored Nov 25, 2023
2 parents 710f2c3 + 8c722ea commit 6a5dec9
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 12 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: tests

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
check_skip:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[ci skip]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
experimental: [false]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'requirements*'
- name: check OS
run: cat /etc/os-release
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends git make gcc
- name: Install/upgrade Python setup deps
run: python3 -m pip install --upgrade pip setuptools wheel
- name: Install dev requirements
run: |
pip install -r requirements-dev.txt
- name: Install SalesGPT
run: |
python3 -m pip install .
python3 setup.py egg_info
- name: Unit tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
export OPENAI_API_KEY=$OPENAI_API_KEY
make test
170 changes: 170 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,173 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST

WadaSNR/
.idea/
*.pyc
.DS_Store
./__init__.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
.static_storage/
.media/
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# vim
*.swp
*.swm
*.swn
*.swo

# pytorch models
*.pth
*.pth.tar
!dummy_speakers.pth
result/

# setup.py
version.py

# jupyter dummy files
core

# ignore local datasets
recipes/WIP/*
recipes/ljspeech/LJSpeech-1.1/*
recipes/vctk/VCTK/*
recipes/**/*.npy
recipes/**/*.json
VCTK-Corpus-removed-silence/*

# ignore training logs
trainer_*_log.txt

# files used internally for dev, test etc.
tests/outputs/*
tests/train_outputs/*
TODO.txt
.vscode/*
data/*
notebooks/data/*
TTS/tts/utils/monotonic_align/core.c
.vscode-upload.json
temp_build/*
events.out*
old_configs/*
model_importers/*
model_profiling/*
docs/source/TODO/*
.noseids
.dccache
log.txt
umap.png
*.out
SocialMedia.txt
output.wav
tts_output.wav
deps.json
speakers.json
internal/*
*_pitch.npy
*_phoneme.npy
wandb
depot/*
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test: ## run tests with pytest.
@echo "Running tests..."
@pytest --cov=salesgpt
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

# :robot: SalesGPT - Open Source AI Agent for Sales


<img src="https://demo-bucket-45.s3.amazonaws.com/filtr145_simple_robot_mascot_for_a_sales_company_professional_5282c6e6-40c1-4576-95c8-e4ba3c389f3f.png" width="200">

![GitHub Repo stars](https://img.shields.io/github/stars/filip-michalsky/SalesGPT?style=social)
[![Downloads](https://pepy.tech/badge/salesGPT)](https://pepy.tech/project/salesgpt)
[![License](<https://img.shields.io/badge/License-MIT-brightgreen.svg>)](https://opensource.org/licenses/MIT)
[![PyPI version](https://img.shields.io/pypi/v/salesgpt.svg)](https://badge.fury.io/py/salesgpt)
![GithubActions](https://github.com/filip-michalsky/SalesGPT/actions/workflows/unit-tests.yml/badge.svg)


</div>
<div align="center">

Expand All @@ -18,7 +26,7 @@ Morever, SalesGPT has access to tools, such as your own pre-defined product know

# Our Vision: Build the Best Open Source AI Sales Agent

We are building SalesGPT to power your best Autonomous Sales Agents. Hence, we would love to learn more about use cases you are building towards which will fuel SalesGPT development roadmap, so please don't hesitate to reach out.
We are building SalesGPT to power your best AI Sales Agents. Hence, we would love to learn more about use cases you are building towards which will fuel SalesGPT development roadmap, so please don't hesitate to reach out.

# Features

Expand Down Expand Up @@ -68,7 +76,7 @@ The AI Sales Agent understands the conversation stage (you can define your own s

# Contact Us for Suggestions, Questions, or Help

We are building SalesGPT to power your best Autonomous Sales Agents. Hence, we would love to learn more about use cases you are building towards which will fuel SalesGPT development roadmap.
We are building SalesGPT to power your best AI Sales Agents. Hence, we would love to learn more about use cases you are building towards which will fuel SalesGPT development roadmap.

**If you want us to build better towards your needs, or need help with your AI Sales Agents, please reach out to chat with us: [SalesGPT Use Case Intake Survey](https://5b7mfhwiany.typeform.com/to/n6CbtxJm?utm_source=github-salesgpt&utm_medium=readme&utm_campaign=leads)**

Expand Down Expand Up @@ -206,12 +214,20 @@ We leverage the [`langchain`](https://github.com/hwchase17/langchain) library in
2) Documenting the API
3) Code Documentation
4) Refactor
5) Agent Parsing Reliability
7) Deployment Instructions
8) Calling Functionality
5) Improve reliability of the parser [issue here](https://github.com/filip-michalsky/SalesGPT/issues/26) and [here](https://github.com/filip-michalsky/SalesGPT/issues/25)
7) Improve Deployment Instructions
8) Calling Functionality - sample code
9) Enterprise-Grade Security - integration with [PromptArmor](https://promptarmor.com/) to protect your AI Sales Agents against security vulnerabilities
10) LLM evaluations
11) Resolve tickets and PRs (ongoing)
12) Add example implementation of OpenAI functions agent[issue here](https://github.com/filip-michalsky/SalesGPT/issues/17)
13) Add support for multiple tools [issue here](https://github.com/filip-michalsky/SalesGPT/issues/10)
14) Add an agent controller for when stages need to be traversed linearly without skips [issue here](https://github.com/filip-michalsky/SalesGPT/issues/19)
15) Add `tool_getter` to choose a tool based on vector distance to the tasks needed to be done
16) What tools should the agent have? (e.g., the ability to search the internet)
17) Add the ability of Sales Agent to interact with AI plugins on your website (.well-known/ai-plugin.json)
18) More SalesGPT examples


# About the Team

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ flake8>=6.0.0
isort>=5.12.0
pytest>=7.3.2
pytest-asyncio>=0.21.1
pytest-cov>=2.12.1

-r requirements.txt
10 changes: 5 additions & 5 deletions salesgpt/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def _create_retry_decorator(llm: Any) -> Callable[[Any], Any]:
import openai

errors = [
openai.error.Timeout,
openai.error.APIError,
openai.error.APIConnectionError,
openai.error.RateLimitError,
openai.error.ServiceUnavailableError,
openai.Timeout,
openai.APIError,
openai.APIConnectionError,
openai.RateLimitError,
openai.APIStatusError,
]
return create_base_retry_decorator(error_types=errors, max_retries=llm.max_retries)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_salesgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_valid_inference_stream(self, load_env):
stream_generator = sales_agent.step(stream=True)
agent_output = ""
for chunk in stream_generator:
token = chunk["choices"][0]["delta"].get("content", "")
token = chunk["choices"][0]["delta"].get("content", "") or ""
agent_output += token

assert agent_output is not None, "Agent output cannot be None."
Expand Down Expand Up @@ -144,7 +144,7 @@ async def test_valid_async_inference_stream(self, load_env):
assert is_async_generator == True, "This needs to be an async generator!"
agent_output = ""
async for chunk in astream_generator:
token = chunk["choices"][0]["delta"].get("content", "")
token = chunk["choices"][0]["delta"].get("content", "") or ""
agent_output += token

assert agent_output is not None, "Agent output cannot be None."
Expand Down

0 comments on commit 6a5dec9

Please sign in to comment.