Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code updates for 0.1.112 #555

Merged
merged 25 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e2dba7f
Update Readme with Preview Info (#1)
May 31, 2024
1aeddcd
The Big Diff (#2)
ajar98 May 31, 2024
3d7f0d3
Update README.md
ajar98 May 31, 2024
78cda9e
Update README.md
ajar98 Jun 2, 2024
eaaf4d1
fix turn based quickstart (#3)
ajar98 Jun 4, 2024
8380911
[hotfix] remove unused import (#4)
ajar98 Jun 4, 2024
8c53bfe
Update README.md
ajar98 Jun 6, 2024
69df5bc
Update README.md
ajar98 Jun 6, 2024
e1f6fbd
Remove create_speech() from rime synthesizer (#6)
adnaans Jun 6, 2024
239addb
Fix default factory for elevenlabs WS (#12)
ajar98 Jun 7, 2024
cfd6226
Merge In Recent Fixes (#14)
Jun 7, 2024
7401140
[docs sprint] Updates docs for using transcribers (#9)
ajar98 Jun 10, 2024
dfa66d5
[docs sprint] phrase trigger documentation (#16)
adnaans Jun 10, 2024
dac505a
[docs sprint] update open source quickstarts (#15)
adnaans Jun 10, 2024
ddfd6dc
[docs sprint] Add Documentation on Using Vocode's Loguru Implementati…
Jun 11, 2024
45b3749
[docs sprint] Updates docs for using synthesizers (#8)
ajar98 Jun 12, 2024
67eaf1f
[docs sprint] Updates docs for react quickstart (#10)
ajar98 Jun 12, 2024
508a472
changes azure to override create_speech_uncached (#21)
ajar98 Jun 12, 2024
0af1607
[docs sprint] Adds docs for conversation mechanics and moves endpoint…
ajar98 Jun 12, 2024
221b69a
updates docs for events manager (#7)
ajar98 Jun 12, 2024
5dc841a
add cartesia synthesizer (#17)
rjheeta Jun 12, 2024
4625cde
Unset docs / README changes
ajar98 Jun 13, 2024
065607b
Unset docs changes (cont.)
ajar98 Jun 13, 2024
449cbdb
unset poetry version change
ajar98 Jun 13, 2024
9e93296
update poetry.lock
ajar98 Jun 13, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
poetry-version:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ transcribe:
synthesize:
poetry run python playground/streaming/synthesizer/synthesize.py

turn_based_conversation:
poetry run python quickstarts/turn_based_conversation.py

streaming_conversation:
poetry run python quickstarts/streaming_conversation.py

PYTHON_FILES=.
lint: PYTHON_FILES=vocode/ quickstarts/ playground/
lint_diff typecheck_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$')
Expand Down
2 changes: 1 addition & 1 deletion apps/client_backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ RUN poetry config virtualenvs.create false
RUN poetry install --no-dev --no-interaction --no-ansi
COPY main.py /code/main.py

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]
17 changes: 6 additions & 11 deletions apps/client_backend/main.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import logging
from dotenv import load_dotenv
from fastapi import FastAPI

from vocode.streaming.models.agent import ChatGPTAgentConfig
from vocode.streaming.models.synthesizer import AzureSynthesizerConfig
from vocode.streaming.synthesizer.azure_synthesizer import AzureSynthesizer

from vocode.logging import configure_pretty_logging
from vocode.streaming.agent.chat_gpt_agent import ChatGPTAgent
from vocode.streaming.client_backend.conversation import ConversationRouter
from vocode.streaming.models.agent import ChatGPTAgentConfig
from vocode.streaming.models.message import BaseMessage

from dotenv import load_dotenv
from vocode.streaming.models.synthesizer import AzureSynthesizerConfig
from vocode.streaming.synthesizer.azure_synthesizer import AzureSynthesizer

load_dotenv()

app = FastAPI(docs_url=None)

logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
configure_pretty_logging()

conversation_router = ConversationRouter(
agent_thunk=lambda: ChatGPTAgent(
Expand All @@ -31,7 +27,6 @@
output_audio_config, voice_name="en-US-SteffanNeural"
)
),
logger=logger,
)

app.include_router(conversation_router.get_router())
3,373 changes: 2,384 additions & 989 deletions apps/client_backend/poetry.lock

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions apps/client_backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
python-dotenv = "^1.0.0"
vocode = "0.1.111"
elevenlabs = "^0.2.23"
python-dotenv = "^1.0.1"
vocode = { path = "../..", extras = [
"all",
], develop = true, python = ">=3.11,<3.12" }
elevenlabs = "^1.2.2"


[build-system]
Expand Down
2 changes: 1 addition & 1 deletion apps/telephony_app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ RUN poetry install --no-dev --no-interaction --no-ansi
COPY main.py /code/main.py
COPY speller_agent.py /code/speller_agent.py

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]
10 changes: 5 additions & 5 deletions apps/telephony_app/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ services:
image: redis:7.0.9-alpine
command: redis-server --bind 0.0.0.0
ports:
- 6379:6379
- 6379:6379
app:
image: vocode-telephony-app
env_file:
- .env
- .env
ports:
- 3000:3000
- 3000:3000
depends_on:
- redis
- redis
environment:
- REDISHOST=redis
- REDISHOST=redis
42 changes: 17 additions & 25 deletions apps/telephony_app/main.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
# Standard library imports
import logging
import os
import sys

from dotenv import load_dotenv

# Third-party imports
from fastapi import FastAPI
from vocode.streaming.models.telephony import TwilioConfig
from loguru import logger
from pyngrok import ngrok
from vocode.streaming.telephony.config_manager.redis_config_manager import (
RedisConfigManager,
)
from vocode.streaming.models.agent import ChatGPTAgentConfig
from vocode.streaming.models.message import BaseMessage
from vocode.streaming.telephony.server.base import (
TwilioInboundCallConfig,
TelephonyServer,
)
from dotenv import load_dotenv

# Local application/library specific imports
from speller_agent import (
SpellerAgentFactory,
SpellerAgentConfig,
)
from speller_agent import SpellerAgentFactory

from vocode.logging import configure_pretty_logging
from vocode.streaming.models.agent import ChatGPTAgentConfig
from vocode.streaming.models.message import BaseMessage
from vocode.streaming.models.telephony import TwilioConfig
from vocode.streaming.telephony.config_manager.redis_config_manager import RedisConfigManager
from vocode.streaming.telephony.server.base import TelephonyServer, TwilioInboundCallConfig

# if running from python, this will load the local .env
# docker-compose will load the .env file by itself
load_dotenv()

app = FastAPI(docs_url=None)
configure_pretty_logging()

logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
app = FastAPI(docs_url=None)

config_manager = RedisConfigManager(
logger=logger,
)
config_manager = RedisConfigManager()

BASE_URL = os.getenv("BASE_URL")

Expand Down Expand Up @@ -66,7 +57,9 @@
),
# uncomment this to use the speller agent instead
# agent_config=SpellerAgentConfig(
# initial_message=BaseMessage(text="im a speller agent, say something to me and ill spell it out for you"),
# initial_message=BaseMessage(
# text="im a speller agent, say something to me and ill spell it out for you"
# ),
# generate_responses=False,
# ),
twilio_config=TwilioConfig(
Expand All @@ -76,7 +69,6 @@
)
],
agent_factory=SpellerAgentFactory(),
logger=logger,
)

app.include_router(telephony_server.get_router())
25 changes: 19 additions & 6 deletions apps/telephony_app/outbound_call.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import os

from dotenv import load_dotenv

load_dotenv()
from vocode.streaming.models.agent import ChatGPTAgentConfig
from vocode.streaming.models.message import BaseMessage
from vocode.streaming.models.telephony import TwilioConfig

from vocode.streaming.telephony.conversation.outbound_call import OutboundCall
from vocode.streaming.telephony.config_manager.redis_config_manager import (
RedisConfigManager,
)
load_dotenv()

from speller_agent import SpellerAgentConfig

from vocode.streaming.telephony.config_manager.redis_config_manager import RedisConfigManager
from vocode.streaming.telephony.conversation.outbound_call import OutboundCall

BASE_URL = os.environ["BASE_URL"]


Expand All @@ -21,12 +24,22 @@ async def main():
to_phone="+15555555555",
from_phone="+15555555555",
config_manager=config_manager,
agent_config=SpellerAgentConfig(generate_responses=False),
agent_config=ChatGPTAgentConfig(
initial_message=BaseMessage(text="What up"),
prompt_preamble="Have a pleasant conversation about life",
generate_responses=True,
),
telephony_config=TwilioConfig(
account_sid=os.environ["TWILIO_ACCOUNT_SID"],
auth_token=os.environ["TWILIO_AUTH_TOKEN"],
),
)

input("Press enter to start call...")
await outbound_call.start()


if __name__ == "__main__":
import asyncio

asyncio.run(main())
Loading
Loading