pipecat-ai 0.0.10__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.
Files changed (283) hide show
  1. pipecat_ai-0.0.10/.dockerignore +30 -0
  2. pipecat_ai-0.0.10/.github/workflows/build.yaml +44 -0
  3. pipecat_ai-0.0.10/.github/workflows/lint.yaml +44 -0
  4. pipecat_ai-0.0.10/.github/workflows/publish.yaml +84 -0
  5. pipecat_ai-0.0.10/.github/workflows/publish_test.yaml +63 -0
  6. pipecat_ai-0.0.10/.github/workflows/tests.yaml +49 -0
  7. pipecat_ai-0.0.10/.gitignore +30 -0
  8. pipecat_ai-0.0.10/Dockerfile +40 -0
  9. pipecat_ai-0.0.10/LICENSE +24 -0
  10. pipecat_ai-0.0.10/PKG-INFO +276 -0
  11. pipecat_ai-0.0.10/README.md +221 -0
  12. pipecat_ai-0.0.10/dev-requirements.txt +6 -0
  13. pipecat_ai-0.0.10/docs/README.md +10 -0
  14. pipecat_ai-0.0.10/docs/architecture.md +17 -0
  15. pipecat_ai-0.0.10/docs/frame-progress.md +46 -0
  16. pipecat_ai-0.0.10/docs/images/frame-progress-01.png +0 -0
  17. pipecat_ai-0.0.10/docs/images/frame-progress-02.png +0 -0
  18. pipecat_ai-0.0.10/docs/images/frame-progress-03.png +0 -0
  19. pipecat_ai-0.0.10/docs/images/frame-progress-04.png +0 -0
  20. pipecat_ai-0.0.10/docs/images/frame-progress-05.png +0 -0
  21. pipecat_ai-0.0.10/docs/images/frame-progress-06.png +0 -0
  22. pipecat_ai-0.0.10/docs/images/frame-progress-07.png +0 -0
  23. pipecat_ai-0.0.10/docs/images/frame-progress-08.png +0 -0
  24. pipecat_ai-0.0.10/docs/images/frame-progress-09.png +0 -0
  25. pipecat_ai-0.0.10/docs/images/frame-progress-10.png +0 -0
  26. pipecat_ai-0.0.10/docs/images/frame-progress-11.png +0 -0
  27. pipecat_ai-0.0.10/docs/images/frame-progress-12.png +0 -0
  28. pipecat_ai-0.0.10/docs/images/frame-progress-13.png +0 -0
  29. pipecat_ai-0.0.10/docs/images/frame-progress-14.png +0 -0
  30. pipecat_ai-0.0.10/docs/images/frame-progress-15.png +0 -0
  31. pipecat_ai-0.0.10/dot-env.template +35 -0
  32. pipecat_ai-0.0.10/examples/README.md +84 -0
  33. pipecat_ai-0.0.10/examples/foundational/01-say-one-thing.py +56 -0
  34. pipecat_ai-0.0.10/examples/foundational/01a-local-audio.py +53 -0
  35. pipecat_ai-0.0.10/examples/foundational/02-llm-say-one-thing.py +68 -0
  36. pipecat_ai-0.0.10/examples/foundational/03-still-frame.py +68 -0
  37. pipecat_ai-0.0.10/examples/foundational/03a-local-still-frame.py +68 -0
  38. pipecat_ai-0.0.10/examples/foundational/04-utterance-and-speech.py +86 -0
  39. pipecat_ai-0.0.10/examples/foundational/05-sync-speech-and-image.py +164 -0
  40. pipecat_ai-0.0.10/examples/foundational/05a-local-sync-speech-and-image.py +164 -0
  41. pipecat_ai-0.0.10/examples/foundational/06-listen-and-respond.py +94 -0
  42. pipecat_ai-0.0.10/examples/foundational/06a-image-sync.py +116 -0
  43. pipecat_ai-0.0.10/examples/foundational/07-interruptible.py +75 -0
  44. pipecat_ai-0.0.10/examples/foundational/08-bots-arguing.py +148 -0
  45. pipecat_ai-0.0.10/examples/foundational/09-mirror.py +62 -0
  46. pipecat_ai-0.0.10/examples/foundational/09a-local-mirror.py +65 -0
  47. pipecat_ai-0.0.10/examples/foundational/10-wake-word.py +181 -0
  48. pipecat_ai-0.0.10/examples/foundational/11-sound-effects.py +132 -0
  49. pipecat_ai-0.0.10/examples/foundational/12-describe-video.py +104 -0
  50. pipecat_ai-0.0.10/examples/foundational/13-whisper-transcription.py +55 -0
  51. pipecat_ai-0.0.10/examples/foundational/13a-whisper-local.py +55 -0
  52. pipecat_ai-0.0.10/examples/foundational/assets/ding1.wav +0 -0
  53. pipecat_ai-0.0.10/examples/foundational/assets/ding2.wav +0 -0
  54. pipecat_ai-0.0.10/examples/foundational/assets/sc-default.png +0 -0
  55. pipecat_ai-0.0.10/examples/foundational/assets/sc-listen-1.png +0 -0
  56. pipecat_ai-0.0.10/examples/foundational/assets/sc-listen-2.png +0 -0
  57. pipecat_ai-0.0.10/examples/foundational/assets/sc-talk.png +0 -0
  58. pipecat_ai-0.0.10/examples/foundational/assets/sc-think-1.png +0 -0
  59. pipecat_ai-0.0.10/examples/foundational/assets/sc-think-2.png +0 -0
  60. pipecat_ai-0.0.10/examples/foundational/assets/sc-think-3.png +0 -0
  61. pipecat_ai-0.0.10/examples/foundational/assets/sc-think-4.png +0 -0
  62. pipecat_ai-0.0.10/examples/foundational/assets/speaking.png +0 -0
  63. pipecat_ai-0.0.10/examples/foundational/assets/waiting.png +0 -0
  64. pipecat_ai-0.0.10/examples/foundational/runner.py +58 -0
  65. pipecat_ai-0.0.10/examples/foundational/websocket-server/frames.proto +25 -0
  66. pipecat_ai-0.0.10/examples/foundational/websocket-server/index.html +134 -0
  67. pipecat_ai-0.0.10/examples/foundational/websocket-server/sample.py +50 -0
  68. pipecat_ai-0.0.10/examples/moondream-chatbot/.dockerignore +163 -0
  69. pipecat_ai-0.0.10/examples/moondream-chatbot/.gitignore +161 -0
  70. pipecat_ai-0.0.10/examples/moondream-chatbot/Dockerfile +25 -0
  71. pipecat_ai-0.0.10/examples/moondream-chatbot/Dockerfile.intel +76 -0
  72. pipecat_ai-0.0.10/examples/moondream-chatbot/README.md +44 -0
  73. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot01.png +0 -0
  74. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot010.png +0 -0
  75. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot011.png +0 -0
  76. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot012.png +0 -0
  77. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot013.png +0 -0
  78. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot014.png +0 -0
  79. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot015.png +0 -0
  80. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot016.png +0 -0
  81. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot017.png +0 -0
  82. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot018.png +0 -0
  83. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot019.png +0 -0
  84. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot02.png +0 -0
  85. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot020.png +0 -0
  86. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot021.png +0 -0
  87. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot022.png +0 -0
  88. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot023.png +0 -0
  89. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot024.png +0 -0
  90. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot025.png +0 -0
  91. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot03.png +0 -0
  92. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot04.png +0 -0
  93. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot05.png +0 -0
  94. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot06.png +0 -0
  95. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot07.png +0 -0
  96. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot08.png +0 -0
  97. pipecat_ai-0.0.10/examples/moondream-chatbot/assets/robot09.png +0 -0
  98. pipecat_ai-0.0.10/examples/moondream-chatbot/bot.py +195 -0
  99. pipecat_ai-0.0.10/examples/moondream-chatbot/env.example +4 -0
  100. pipecat_ai-0.0.10/examples/moondream-chatbot/image.png +0 -0
  101. pipecat_ai-0.0.10/examples/moondream-chatbot/requirements.txt +5 -0
  102. pipecat_ai-0.0.10/examples/moondream-chatbot/runner.py +58 -0
  103. pipecat_ai-0.0.10/examples/moondream-chatbot/server.py +124 -0
  104. pipecat_ai-0.0.10/examples/moondream-chatbot/utils/daily_helpers.py +109 -0
  105. pipecat_ai-0.0.10/examples/simple-chatbot/.gitignore +161 -0
  106. pipecat_ai-0.0.10/examples/simple-chatbot/Dockerfile +16 -0
  107. pipecat_ai-0.0.10/examples/simple-chatbot/README.md +37 -0
  108. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot01.png +0 -0
  109. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot010.png +0 -0
  110. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot011.png +0 -0
  111. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot012.png +0 -0
  112. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot013.png +0 -0
  113. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot014.png +0 -0
  114. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot015.png +0 -0
  115. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot016.png +0 -0
  116. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot017.png +0 -0
  117. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot018.png +0 -0
  118. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot019.png +0 -0
  119. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot02.png +0 -0
  120. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot020.png +0 -0
  121. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot021.png +0 -0
  122. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot022.png +0 -0
  123. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot023.png +0 -0
  124. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot024.png +0 -0
  125. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot025.png +0 -0
  126. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot03.png +0 -0
  127. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot04.png +0 -0
  128. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot05.png +0 -0
  129. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot06.png +0 -0
  130. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot07.png +0 -0
  131. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot08.png +0 -0
  132. pipecat_ai-0.0.10/examples/simple-chatbot/assets/robot09.png +0 -0
  133. pipecat_ai-0.0.10/examples/simple-chatbot/bot.py +135 -0
  134. pipecat_ai-0.0.10/examples/simple-chatbot/env.example +4 -0
  135. pipecat_ai-0.0.10/examples/simple-chatbot/image.png +0 -0
  136. pipecat_ai-0.0.10/examples/simple-chatbot/requirements.txt +5 -0
  137. pipecat_ai-0.0.10/examples/simple-chatbot/runner.py +58 -0
  138. pipecat_ai-0.0.10/examples/simple-chatbot/server.py +124 -0
  139. pipecat_ai-0.0.10/examples/simple-chatbot/utils/daily_helpers.py +109 -0
  140. pipecat_ai-0.0.10/examples/storytelling-chatbot/.dockerignore +2 -0
  141. pipecat_ai-0.0.10/examples/storytelling-chatbot/.gitignore +158 -0
  142. pipecat_ai-0.0.10/examples/storytelling-chatbot/Dockerfile +54 -0
  143. pipecat_ai-0.0.10/examples/storytelling-chatbot/README.md +83 -0
  144. pipecat_ai-0.0.10/examples/storytelling-chatbot/env.example +6 -0
  145. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/.eslintrc.json +3 -0
  146. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/.gitignore +36 -0
  147. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/README.md +36 -0
  148. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/favicon.ico +0 -0
  149. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/globals.css +109 -0
  150. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/layout.tsx +46 -0
  151. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/opengraph-image.png +0 -0
  152. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/page.tsx +16 -0
  153. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/twitter-image.png +0 -0
  154. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/app/utils.ts +6 -0
  155. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/App.tsx +90 -0
  156. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/AudioIndicator/index.tsx +69 -0
  157. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/DevicePicker/index.tsx +139 -0
  158. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/MicToggle/index.tsx +34 -0
  159. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/Setup.tsx +93 -0
  160. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/Story.tsx +79 -0
  161. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/StoryTranscript/StoryTranscript.module.css +42 -0
  162. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/StoryTranscript/index.tsx +55 -0
  163. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/UserInputIndicator/UserInputIndicator.module.css +82 -0
  164. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/UserInputIndicator/index.tsx +48 -0
  165. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/VideoTile/VideoTile.module.css +34 -0
  166. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/VideoTile/index.tsx +27 -0
  167. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/WaveText/WaveText.module.css +68 -0
  168. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/WaveText/index.tsx +23 -0
  169. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/ui/button.tsx +56 -0
  170. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/ui/select.tsx +160 -0
  171. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components/ui/typewriter.tsx +61 -0
  172. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/components.json +17 -0
  173. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/env.example +2 -0
  174. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/next.config.mjs +15 -0
  175. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/package.json +38 -0
  176. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/postcss.config.js +6 -0
  177. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/public/alpha-mask.gif +0 -0
  178. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/public/bg.jpg +0 -0
  179. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/tailwind.config.ts +86 -0
  180. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/tsconfig.json +40 -0
  181. pipecat_ai-0.0.10/examples/storytelling-chatbot/frontend/yarn.lock +3248 -0
  182. pipecat_ai-0.0.10/examples/storytelling-chatbot/image.png +0 -0
  183. pipecat_ai-0.0.10/examples/storytelling-chatbot/requirements.txt +5 -0
  184. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/assets/book1.png +0 -0
  185. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/assets/book2.png +0 -0
  186. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/assets/ding.wav +0 -0
  187. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/assets/listening.wav +0 -0
  188. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/assets/talking.wav +0 -0
  189. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/bot.py +172 -0
  190. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/processors.py +148 -0
  191. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/prompts.py +35 -0
  192. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/server.py +175 -0
  193. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/utils/daily_helpers.py +109 -0
  194. pipecat_ai-0.0.10/examples/storytelling-chatbot/src/utils/helpers.py +33 -0
  195. pipecat_ai-0.0.10/examples/translation-chatbot/.gitignore +161 -0
  196. pipecat_ai-0.0.10/examples/translation-chatbot/Dockerfile +14 -0
  197. pipecat_ai-0.0.10/examples/translation-chatbot/README.md +33 -0
  198. pipecat_ai-0.0.10/examples/translation-chatbot/bot.py +121 -0
  199. pipecat_ai-0.0.10/examples/translation-chatbot/env.example +5 -0
  200. pipecat_ai-0.0.10/examples/translation-chatbot/image.png +0 -0
  201. pipecat_ai-0.0.10/examples/translation-chatbot/requirements.txt +4 -0
  202. pipecat_ai-0.0.10/examples/translation-chatbot/runner.py +58 -0
  203. pipecat_ai-0.0.10/examples/translation-chatbot/server.py +124 -0
  204. pipecat_ai-0.0.10/examples/translation-chatbot/utils/daily_helpers.py +109 -0
  205. pipecat_ai-0.0.10/linux-py3.10-requirements.txt +267 -0
  206. pipecat_ai-0.0.10/macos-py3.10-requirements.txt +233 -0
  207. pipecat_ai-0.0.10/pipecat.png +0 -0
  208. pipecat_ai-0.0.10/pyproject.toml +57 -0
  209. pipecat_ai-0.0.10/setup.cfg +4 -0
  210. pipecat_ai-0.0.10/src/pipecat/__init__.py +0 -0
  211. pipecat_ai-0.0.10/src/pipecat/frames/__init__.py +0 -0
  212. pipecat_ai-0.0.10/src/pipecat/frames/frames.proto +31 -0
  213. pipecat_ai-0.0.10/src/pipecat/frames/frames.py +284 -0
  214. pipecat_ai-0.0.10/src/pipecat/frames/protobufs/frames_pb2.py +32 -0
  215. pipecat_ai-0.0.10/src/pipecat/pipeline/__init__.py +0 -0
  216. pipecat_ai-0.0.10/src/pipecat/pipeline/merge_pipeline.py +24 -0
  217. pipecat_ai-0.0.10/src/pipecat/pipeline/parallel_pipeline.py +137 -0
  218. pipecat_ai-0.0.10/src/pipecat/pipeline/pipeline.py +76 -0
  219. pipecat_ai-0.0.10/src/pipecat/pipeline/runner.py +60 -0
  220. pipecat_ai-0.0.10/src/pipecat/pipeline/task.py +93 -0
  221. pipecat_ai-0.0.10/src/pipecat/processors/__init__.py +0 -0
  222. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/__init__.py +0 -0
  223. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/gated.py +72 -0
  224. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/llm_context.py +82 -0
  225. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/llm_response.py +189 -0
  226. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/openai_llm_context.py +175 -0
  227. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/parallel_task.py +104 -0
  228. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/sentence.py +52 -0
  229. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/user_response.py +139 -0
  230. pipecat_ai-0.0.10/src/pipecat/processors/aggregators/vision_image_frame.py +45 -0
  231. pipecat_ai-0.0.10/src/pipecat/processors/filter.py +34 -0
  232. pipecat_ai-0.0.10/src/pipecat/processors/frame_processor.py +57 -0
  233. pipecat_ai-0.0.10/src/pipecat/processors/logger.py +22 -0
  234. pipecat_ai-0.0.10/src/pipecat/processors/text_transformer.py +36 -0
  235. pipecat_ai-0.0.10/src/pipecat/processors/utils/audio.py +25 -0
  236. pipecat_ai-0.0.10/src/pipecat/serializers/abstract_frame_serializer.py +16 -0
  237. pipecat_ai-0.0.10/src/pipecat/serializers/protobuf_serializer.py +64 -0
  238. pipecat_ai-0.0.10/src/pipecat/services/__init__.py +0 -0
  239. pipecat_ai-0.0.10/src/pipecat/services/ai_services.py +171 -0
  240. pipecat_ai-0.0.10/src/pipecat/services/anthropic.py +51 -0
  241. pipecat_ai-0.0.10/src/pipecat/services/azure.py +164 -0
  242. pipecat_ai-0.0.10/src/pipecat/services/deepgram.py +36 -0
  243. pipecat_ai-0.0.10/src/pipecat/services/elevenlabs.py +58 -0
  244. pipecat_ai-0.0.10/src/pipecat/services/fal.py +83 -0
  245. pipecat_ai-0.0.10/src/pipecat/services/fireworks.py +24 -0
  246. pipecat_ai-0.0.10/src/pipecat/services/moondream.py +88 -0
  247. pipecat_ai-0.0.10/src/pipecat/services/ollama.py +13 -0
  248. pipecat_ai-0.0.10/src/pipecat/services/openai.py +197 -0
  249. pipecat_ai-0.0.10/src/pipecat/services/playht.py +72 -0
  250. pipecat_ai-0.0.10/src/pipecat/services/to_be_updated/__init__.py +0 -0
  251. pipecat_ai-0.0.10/src/pipecat/services/to_be_updated/cloudflare_ai_service.py +71 -0
  252. pipecat_ai-0.0.10/src/pipecat/services/to_be_updated/google_ai_service.py +31 -0
  253. pipecat_ai-0.0.10/src/pipecat/services/to_be_updated/huggingface_ai_service.py +33 -0
  254. pipecat_ai-0.0.10/src/pipecat/services/to_be_updated/mock_ai_service.py +27 -0
  255. pipecat_ai-0.0.10/src/pipecat/services/whisper.py +74 -0
  256. pipecat_ai-0.0.10/src/pipecat/storage/__init__.py +0 -0
  257. pipecat_ai-0.0.10/src/pipecat/storage/search.py +9 -0
  258. pipecat_ai-0.0.10/src/pipecat/transports/base_input.py +141 -0
  259. pipecat_ai-0.0.10/src/pipecat/transports/base_output.py +193 -0
  260. pipecat_ai-0.0.10/src/pipecat/transports/base_transport.py +40 -0
  261. pipecat_ai-0.0.10/src/pipecat/transports/local/__init__.py +0 -0
  262. pipecat_ai-0.0.10/src/pipecat/transports/local/audio.py +93 -0
  263. pipecat_ai-0.0.10/src/pipecat/transports/local/tk.py +130 -0
  264. pipecat_ai-0.0.10/src/pipecat/transports/services/daily.py +743 -0
  265. pipecat_ai-0.0.10/src/pipecat/utils/__init__.py +0 -0
  266. pipecat_ai-0.0.10/src/pipecat/utils/utils.py +31 -0
  267. pipecat_ai-0.0.10/src/pipecat/vad/__init__.py +0 -0
  268. pipecat_ai-0.0.10/src/pipecat/vad/silero.py +103 -0
  269. pipecat_ai-0.0.10/src/pipecat/vad/vad_analyzer.py +104 -0
  270. pipecat_ai-0.0.10/src/pipecat_ai.egg-info/PKG-INFO +276 -0
  271. pipecat_ai-0.0.10/src/pipecat_ai.egg-info/SOURCES.txt +281 -0
  272. pipecat_ai-0.0.10/src/pipecat_ai.egg-info/dependency_links.txt +1 -0
  273. pipecat_ai-0.0.10/src/pipecat_ai.egg-info/requires.txt +49 -0
  274. pipecat_ai-0.0.10/src/pipecat_ai.egg-info/top_level.txt +1 -0
  275. pipecat_ai-0.0.10/tests/integration/integration_azure_llm.py +26 -0
  276. pipecat_ai-0.0.10/tests/integration/integration_ollama_llm.py +21 -0
  277. pipecat_ai-0.0.10/tests/integration/integration_openai_llm.py +83 -0
  278. pipecat_ai-0.0.10/tests/test_aggregators.py +129 -0
  279. pipecat_ai-0.0.10/tests/test_ai_services.py +32 -0
  280. pipecat_ai-0.0.10/tests/test_daily_transport_service.py +86 -0
  281. pipecat_ai-0.0.10/tests/test_pipeline.py +111 -0
  282. pipecat_ai-0.0.10/tests/test_protobuf_serializer.py +30 -0
  283. pipecat_ai-0.0.10/tests/test_websocket_transport.py +113 -0
@@ -0,0 +1,30 @@
1
+ # flyctl launch added from .gitignore
2
+ **/.vscode
3
+ **/env
4
+ **/__pycache__
5
+ **/*~
6
+ **/venv
7
+ #*#
8
+
9
+ # Distribution / packaging
10
+ **/.Python
11
+ **/build
12
+ **/develop-eggs
13
+ **/dist
14
+ **/downloads
15
+ **/eggs
16
+ **/.eggs
17
+ **/lib
18
+ **/lib64
19
+ **/parts
20
+ **/sdist
21
+ **/var
22
+ **/wheels
23
+ **/share/python-wheels
24
+ **/*.egg-info
25
+ **/.installed.cfg
26
+ **/*.egg
27
+ **/MANIFEST
28
+ **/.DS_Store
29
+ **/.env
30
+ fly.toml
@@ -0,0 +1,44 @@
1
+ name: build
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - "**"
11
+ paths-ignore:
12
+ - "docs/**"
13
+
14
+ concurrency:
15
+ group: build-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ build:
20
+ name: "Build and Install"
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Python
25
+ id: setup_python
26
+ uses: actions/setup-python@v4
27
+ with:
28
+ python-version: '3.10'
29
+ - name: Setup virtual environment
30
+ run: |
31
+ python -m venv .venv
32
+ - name: Install basic Python dependencies
33
+ run: |
34
+ source .venv/bin/activate
35
+ python -m pip install --upgrade pip
36
+ pip install -r dev-requirements.txt
37
+ - name: Build project
38
+ run: |
39
+ source .venv/bin/activate
40
+ python -m build
41
+ - name: Install project and other Python dependencies
42
+ run: |
43
+ source .venv/bin/activate
44
+ pip install --editable .
@@ -0,0 +1,44 @@
1
+ name: lint
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - "**"
11
+ paths-ignore:
12
+ - "docs/**"
13
+
14
+ concurrency:
15
+ group: build-lint-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ autopep8:
20
+ name: "Formatting lints"
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Checkout repo
24
+ uses: actions/checkout@v4
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v4
27
+ with:
28
+ python-version: '3.10'
29
+ - name: Setup virtual environment
30
+ run: |
31
+ python -m venv .venv
32
+ - name: Install development Python dependencies
33
+ run: |
34
+ source .venv/bin/activate
35
+ python -m pip install --upgrade pip
36
+ pip install -r dev-requirements.txt
37
+ - name: autopep8
38
+ id: autopep8
39
+ run: |
40
+ source .venv/bin/activate
41
+ autopep8 --max-line-length 100 --exit-code -r -d --exclude "*_pb2.py" -a -a src/
42
+ - name: Fail if autopep8 requires changes
43
+ if: steps.autopep8.outputs.exit-code == 2
44
+ run: exit 1
@@ -0,0 +1,84 @@
1
+ name: publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ gitref:
7
+ type: string
8
+ description: "what git ref to build"
9
+ required: true
10
+
11
+ jobs:
12
+ build:
13
+ name: "Build and upload wheels"
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout repo
17
+ uses: actions/checkout@v4
18
+ with:
19
+ ref: ${{ github.event.inputs.gitref }}
20
+ - name: Set up Python
21
+ id: setup_python
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: '3.10'
25
+ - name: Setup virtual environment
26
+ run: |
27
+ python -m venv .venv
28
+ - name: Install basic Python dependencies
29
+ run: |
30
+ source .venv/bin/activate
31
+ python -m pip install --upgrade pip
32
+ pip install -r dev-requirements.txt
33
+ - name: Build project
34
+ run: |
35
+ source .venv/bin/activate
36
+ python -m build
37
+ - name: Upload wheels
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: wheels
41
+ path: ./dist
42
+
43
+ publish-to-pypi:
44
+ name: "Publish to PyPI"
45
+ runs-on: ubuntu-latest
46
+ needs: [ build ]
47
+ environment:
48
+ name: pypi
49
+ url: https://pypi.org/p/pipecat-ai
50
+ permissions:
51
+ id-token: write
52
+ steps:
53
+ - name: Download wheels
54
+ uses: actions/download-artifact@v4
55
+ with:
56
+ name: wheels
57
+ path: ./dist
58
+ - name: Publish to PyPI
59
+ uses: pypa/gh-action-pypi-publish@release/v1
60
+ with:
61
+ verbose: true
62
+ print-hash: true
63
+
64
+ publish-to-test-pypi:
65
+ name: "Publish to Test PyPI"
66
+ runs-on: ubuntu-latest
67
+ needs: [ build ]
68
+ environment:
69
+ name: testpypi
70
+ url: https://pypi.org/p/pipecat-ai
71
+ permissions:
72
+ id-token: write
73
+ steps:
74
+ - name: Download wheels
75
+ uses: actions/download-artifact@v4
76
+ with:
77
+ name: wheels
78
+ path: ./dist
79
+ - name: Publish to PyPI
80
+ uses: pypa/gh-action-pypi-publish@release/v1
81
+ with:
82
+ verbose: true
83
+ print-hash: true
84
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,63 @@
1
+ name: publish-test
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ build:
11
+ name: "Build and upload wheels"
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout repo
15
+ uses: actions/checkout@v4
16
+ with:
17
+ ref: ${{ github.event.inputs.gitref }}
18
+ fetch-tags: true
19
+ fetch-depth: 100
20
+ - name: Set up Python
21
+ id: setup_python
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: '3.10'
25
+ - name: Setup virtual environment
26
+ run: |
27
+ python -m venv .venv
28
+ - name: Install basic Python dependencies
29
+ run: |
30
+ source .venv/bin/activate
31
+ python -m pip install --upgrade pip
32
+ pip install -r dev-requirements.txt
33
+ - name: Build project
34
+ run: |
35
+ source .venv/bin/activate
36
+ python -m build
37
+ - name: Upload wheels
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: wheels
41
+ path: ./dist
42
+
43
+ publish-to-pypi:
44
+ name: "Publish to Test PyPI"
45
+ runs-on: ubuntu-latest
46
+ needs: [ build ]
47
+ environment:
48
+ name: testpypi
49
+ url: https://pypi.org/p/pipecat-ai
50
+ permissions:
51
+ id-token: write
52
+ steps:
53
+ - name: Download wheels
54
+ uses: actions/download-artifact@v4
55
+ with:
56
+ name: wheels
57
+ path: ./dist
58
+ - name: Publish to PyPI
59
+ uses: pypa/gh-action-pypi-publish@release/v1
60
+ with:
61
+ verbose: true
62
+ print-hash: true
63
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,49 @@
1
+ name: test
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - "**"
11
+ paths-ignore:
12
+ - "docs/**"
13
+
14
+ concurrency:
15
+ group: build-test-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ test:
20
+ name: "Unit and Integration Tests"
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Python
25
+ id: setup_python
26
+ uses: actions/setup-python@v4
27
+ with:
28
+ python-version: '3.10'
29
+ - name: Cache virtual environment
30
+ uses: actions/cache@v3
31
+ with:
32
+ # We are hashing requirements-dev.txt and requirements-extra.txt which
33
+ # contain all dependencies needed to run the tests and examples.
34
+ key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('linux-py3.10-requirements.txt') }}-${{ hashFiles('dev-requirements.txt') }}
35
+ path: .venv
36
+ - name: Install system packages
37
+ run: sudo apt-get install -y portaudio19-dev
38
+ - name: Setup virtual environment
39
+ run: |
40
+ python -m venv .venv
41
+ - name: Install basic Python dependencies
42
+ run: |
43
+ source .venv/bin/activate
44
+ python -m pip install --upgrade pip
45
+ pip install -r linux-py3.10-requirements.txt -r dev-requirements.txt
46
+ - name: Test with pytest
47
+ run: |
48
+ source .venv/bin/activate
49
+ pytest --doctest-modules --ignore-glob="*to_be_updated*" src tests
@@ -0,0 +1,30 @@
1
+ .vscode
2
+ env/
3
+ __pycache__/
4
+ *~
5
+ venv
6
+ .venv
7
+ #*#
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+ .DS_Store
29
+ .env
30
+ fly.toml
@@ -0,0 +1,40 @@
1
+ # setup
2
+ FROM python:3.11.5
3
+
4
+ WORKDIR /app
5
+ COPY requirements.txt /app
6
+ COPY *.py /app
7
+ COPY pyproject.toml /app
8
+
9
+ COPY src/ /app/src/
10
+ COPY examples/ /app/examples/
11
+
12
+ WORKDIR /app
13
+ RUN ls --recursive /app/
14
+ RUN pip3 install --upgrade -r requirements.txt
15
+ RUN python -m build .
16
+ RUN pip3 install .
17
+ RUN pip3 install gunicorn
18
+ # If running on Ubuntu, Azure TTS requires some extra config
19
+ # https://learn.microsoft.com/en-us/azure/ai-services/speech-service/quickstarts/setup-platform?pivots=programming-language-python&tabs=linux%2Cubuntu%2Cdotnetcli%2Cdotnet%2Cjre%2Cmaven%2Cnodejs%2Cmac%2Cpypi
20
+
21
+ RUN wget -O - https://www.openssl.org/source/openssl-1.1.1w.tar.gz | tar zxf -
22
+ WORKDIR openssl-1.1.1w
23
+ RUN ./config --prefix=/usr/local
24
+ RUN make -j $(nproc)
25
+ RUN make install_sw install_ssldirs
26
+ RUN ldconfig -v
27
+ ENV SSL_CERT_DIR=/etc/ssl/certs
28
+
29
+ #ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
30
+ RUN apt clean
31
+ RUN apt-get update
32
+ RUN apt-get -y install build-essential libssl-dev ca-certificates libasound2 wget
33
+
34
+ ENV PYTHONUNBUFFERED=1
35
+
36
+ WORKDIR /app
37
+
38
+ EXPOSE 8000
39
+ # run
40
+ CMD ["gunicorn", "--workers=2", "--log-level", "debug", "--chdir", "examples/server", "--capture-output", "daily-bot-manager:app", "--bind=0.0.0.0:8000"]
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2024, Kwindla Hultman Kramer
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,276 @@
1
+ Metadata-Version: 2.1
2
+ Name: pipecat-ai
3
+ Version: 0.0.10
4
+ Summary: An open source framework for voice (and multimodal) assistants
5
+ License: BSD 2-Clause License
6
+ Project-URL: Source, https://github.com/pipecat-ai/pipecat
7
+ Project-URL: Website, https://pipecat.ai
8
+ Keywords: webrtc,audio,video,ai
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: BSD License
12
+ Classifier: Topic :: Communications :: Conferencing
13
+ Classifier: Topic :: Multimedia :: Sound/Audio
14
+ Classifier: Topic :: Multimedia :: Video
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.7
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: aiohttp~=3.9.5
20
+ Requires-Dist: numpy~=1.26.4
21
+ Requires-Dist: loguru~=0.7.0
22
+ Requires-Dist: Pillow~=10.3.0
23
+ Requires-Dist: typing-extensions~=4.11.0
24
+ Provides-Extra: anthropic
25
+ Requires-Dist: anthropic~=0.25.7; extra == "anthropic"
26
+ Provides-Extra: azure
27
+ Requires-Dist: azure-cognitiveservices-speech~=1.37.0; extra == "azure"
28
+ Provides-Extra: daily
29
+ Requires-Dist: daily-python~=0.7.4; extra == "daily"
30
+ Provides-Extra: examples
31
+ Requires-Dist: python-dotenv~=1.0.0; extra == "examples"
32
+ Requires-Dist: flask~=3.0.3; extra == "examples"
33
+ Requires-Dist: flask_cors~=4.0.1; extra == "examples"
34
+ Provides-Extra: fal
35
+ Requires-Dist: fal-client~=0.4.0; extra == "fal"
36
+ Provides-Extra: fireworks
37
+ Requires-Dist: openai~=1.26.0; extra == "fireworks"
38
+ Provides-Extra: local
39
+ Requires-Dist: pyaudio~=0.2.0; extra == "local"
40
+ Provides-Extra: moondream
41
+ Requires-Dist: einops~=0.8.0; extra == "moondream"
42
+ Requires-Dist: timm~=0.9.16; extra == "moondream"
43
+ Requires-Dist: transformers~=4.40.2; extra == "moondream"
44
+ Provides-Extra: openai
45
+ Requires-Dist: openai~=1.26.0; extra == "openai"
46
+ Provides-Extra: playht
47
+ Requires-Dist: pyht~=0.0.28; extra == "playht"
48
+ Provides-Extra: silero
49
+ Requires-Dist: torch~=2.3.0; extra == "silero"
50
+ Requires-Dist: torchaudio~=2.3.0; extra == "silero"
51
+ Provides-Extra: websocket
52
+ Requires-Dist: websockets~=12.0; extra == "websocket"
53
+ Provides-Extra: whisper
54
+ Requires-Dist: faster-whisper~=1.0.2; extra == "whisper"
55
+
56
+ <div align="center">
57
+  <img alt="pipecat" width="300px" height="auto" src="pipecat.png">
58
+ </div>
59
+
60
+ # Pipecat
61
+
62
+ [![PyPI](https://img.shields.io/pypi/v/pipecat-ai)](https://pypi.org/project/pipecat-ai) [![Discord](https://img.shields.io/discord/1239284677165056021
63
+ )](https://discord.gg/pipecat)
64
+
65
+ `pipecat` is a framework for building voice (and multimodal) conversational agents. Things like personal coaches, meeting assistants, [story-telling toys for kids](https://storytelling-chatbot.fly.dev/), customer support bots, [intake flows](https://www.youtube.com/watch?v=lDevgsp9vn0), and snarky social companions.
66
+
67
+ Take a look at some example apps:
68
+
69
+ <p float="left">
70
+ <a href="https://github.com/pipecat-ai/pipecat/tree/main/examples/simple-chatbot"><img src="examples/simple-chatbot/image.png" width="280" /></a>&nbsp;
71
+ <a href="https://github.com/pipecat-ai/pipecat/tree/main/examples/storytelling-chatbot"><img src="examples/storytelling-chatbot/image.png" width="280" /></a>
72
+ <br/>
73
+ <a href="https://github.com/pipecat-ai/pipecat/tree/main/examples/translation-chatbot"><img src="examples/translation-chatbot/image.png" width="280" /></a>&nbsp;
74
+ <a href="https://github.com/pipecat-ai/pipecat/tree/main/examples/moondream-chatbot"><img src="examples/moondream-chatbot/image.png" width="280" /></a>
75
+ </p>
76
+
77
+ ## Getting started with voice agents
78
+
79
+ You can get started with Pipecat running on your local machine, then move your agent processes to the cloud when you’re ready. You can also add a 📞 telephone number, 🖼️ image output, 📺 video input, use different LLMs, and more.
80
+
81
+ ```shell
82
+ # install the module
83
+ pip install pipecat-ai
84
+
85
+ # set up an .env file with API keys
86
+ cp dot-env.template .env
87
+ ```
88
+
89
+ By default, in order to minimize dependencies, only the basic framework functionality is available. Some third-party AI services require additional dependencies that you can install with:
90
+
91
+ ```shell
92
+ pip install "pipecat-ai[option,...]"
93
+ ```
94
+
95
+ Your project may or may not need these, so they're made available as optional requirements. Here is a list:
96
+
97
+ - **AI services**: `anthropic`, `azure`, `fal`, `moondream`, `openai`, `playht`, `silero`, `whisper`
98
+ - **Transports**: `local`, `websocket`, `daily`
99
+
100
+ ## Code examples
101
+
102
+ - [foundational](https://github.com/pipecat-ai/pipecat/tree/main/examples/foundational) — small snippets that build on each other, introducing one or two concepts at a time
103
+ - [example apps](https://github.com/pipecat-ai/pipecat/tree/main/examples/) — complete applications that you can use as starting points for development
104
+
105
+ ## A simple voice agent running locally
106
+
107
+ Here is a very basic Pipecat bot that greets a user when they join a real-time session. We'll use [Daily](https://daily.co) for real-time media transport, and [ElevenLabs](https://elevenlabs.io/) for text-to-speech.
108
+
109
+ ```python
110
+ #app.py
111
+
112
+ import asyncio
113
+ import aiohttp
114
+
115
+ from pipecat.frames.frames import EndFrame, TextFrame
116
+ from pipecat.pipeline.pipeline import Pipeline
117
+ from pipecat.pipeline.task import PipelineTask
118
+ from pipecat.pipeline.runner import PipelineRunner
119
+ from pipecat.services.elevenlabs import ElevenLabsTTSService
120
+ from pipecat.transports.services.daily import DailyParams, DailyTransport
121
+
122
+ async def main():
123
+ async with aiohttp.ClientSession() as session:
124
+ # Use Daily as a real-time media transport (WebRTC)
125
+ transport = DailyTransport(
126
+ room_url=...,
127
+ token=...,
128
+ "Bot Name",
129
+ DailyParams(audio_out_enabled=True))
130
+
131
+ # Use Eleven Labs for Text-to-Speech
132
+ tts = ElevenLabsTTSService(
133
+ aiohttp_session=session,
134
+ api_key=...,
135
+ voice_id=...,
136
+ )
137
+
138
+ # Simple pipeline that will process text to speech and output the result
139
+ pipeline = Pipeline([tts, transport.output()])
140
+
141
+ # Create Pipecat processor that can run one or more pipelines tasks
142
+ runner = PipelineRunner()
143
+
144
+ # Assign the task callable to run the pipeline
145
+ task = PipelineTask(pipeline)
146
+
147
+ # Register an event handler to play audio when a
148
+ # participant joins the transport WebRTC session
149
+ @transport.event_handler("on_participant_joined")
150
+ async def on_new_participant_joined(transport, participant):
151
+ participant_name = participant["info"]["userName"] or ''
152
+ # Queue a TextFrame that will get spoken by the TTS service (Eleven Labs)
153
+ await task.queue_frames([TextFrame(f"Hello there, {participant_name}!"), EndFrame()])
154
+
155
+ # Run the pipeline task
156
+ await runner.run(task)
157
+
158
+ if __name__ == "__main__":
159
+ asyncio.run(main())
160
+ ```
161
+
162
+ Run it with:
163
+
164
+ ```shell
165
+ python app.py
166
+ ```
167
+
168
+ Daily provides a prebuilt WebRTC user interface. Whilst the app is running, you can visit at `https://<yourdomain>.daily.co/<room_url>` and listen to the bot say hello!
169
+
170
+
171
+ ## WebRTC for production use
172
+
173
+ WebSockets are fine for server-to-server communication or for initial development. But for production use, you’ll need client-server audio to use a protocol designed for real-time media transport. (For an explanation of the difference between WebSockets and WebRTC, see [this post.](https://www.daily.co/blog/how-to-talk-to-an-llm-with-your-voice/#webrtc))
174
+
175
+ One way to get up and running quickly with WebRTC is to sign up for a Daily developer account. Daily gives you SDKs and global infrastructure for audio (and video) routing. Every account gets 10,000 audio/video/transcription minutes free each month.
176
+
177
+ Sign up [here](https://dashboard.daily.co/u/signup) and [create a room](https://docs.daily.co/reference/rest-api/rooms) in the developer Dashboard.
178
+
179
+ ## What is VAD?
180
+
181
+ Voice Activity Detection &mdash; very important for knowing when a user has finished speaking to your bot. If you are not using press-to-talk, and want Pipecat to detect when the user has finished talking, VAD is an essential component for a natural feeling conversation.
182
+
183
+ Pipecast makes use of WebRTC VAD by default when using a WebRTC transport layer. Optionally, you can use Silero VAD for improved accuracy at the cost of higher CPU usage.
184
+
185
+ ```shell
186
+ pip install pipecat-ai[silero]
187
+ ```
188
+
189
+ The first time your run your bot with Silero, startup may take a while whilst it downloads and caches the model in the background. You can check the progress of this in the console.
190
+
191
+
192
+ ## Hacking on the framework itself
193
+
194
+ _Note that you may need to set up a virtual environment before following the instructions below. For instance, you might need to run the following from the root of the repo:_
195
+
196
+ ```shell
197
+ python3 -m venv venv
198
+ source venv/bin/activate
199
+ ```
200
+
201
+ From the root of this repo, run the following:
202
+
203
+ ```shell
204
+ pip install -r dev-requirements.txt -r {env}-requirements.txt
205
+ python -m build
206
+ ```
207
+
208
+ This builds the package. To use the package locally (eg to run sample files), run
209
+
210
+ ```shell
211
+ pip install --editable .
212
+ ```
213
+
214
+ If you want to use this package from another directory, you can run:
215
+
216
+ ```shell
217
+ pip install path_to_this_repo
218
+ ```
219
+
220
+ ### Running tests
221
+
222
+ From the root directory, run:
223
+
224
+ ```shell
225
+ pytest --doctest-modules --ignore-glob="*to_be_updated*" src tests
226
+ ```
227
+
228
+ ## Setting up your editor
229
+
230
+ This project uses strict [PEP 8](https://peps.python.org/pep-0008/) formatting.
231
+
232
+ ### Emacs
233
+
234
+ You can use [use-package](https://github.com/jwiegley/use-package) to install [py-autopep8](https://codeberg.org/ideasman42/emacs-py-autopep8) package and configure `autopep8` arguments:
235
+
236
+ ```elisp
237
+ (use-package py-autopep8
238
+ :ensure t
239
+ :defer t
240
+ :hook ((python-mode . py-autopep8-mode))
241
+ :config
242
+ (setq py-autopep8-options '("-a" "-a", "--max-line-length=100")))
243
+ ```
244
+
245
+ `autopep8` was installed in the `venv` environment described before, so you should be able to use [pyvenv-auto](https://github.com/ryotaro612/pyvenv-auto) to automatically load that environment inside Emacs.
246
+
247
+ ```elisp
248
+ (use-package pyvenv-auto
249
+ :ensure t
250
+ :defer t
251
+ :hook ((python-mode . pyvenv-auto-run)))
252
+
253
+ ```
254
+
255
+ ### Visual Studio Code
256
+
257
+ Install the
258
+ [autopep8](https://marketplace.visualstudio.com/items?itemName=ms-python.autopep8) extension. Then edit the user settings (_Ctrl-Shift-P_ `Open User Settings (JSON)`) and set it as the default Python formatter, enable formatting on save and configure `autopep8` arguments:
259
+
260
+ ```json
261
+ "[python]": {
262
+ "editor.defaultFormatter": "ms-python.autopep8",
263
+ "editor.formatOnSave": true
264
+ },
265
+ "autopep8.args": [
266
+ "-a",
267
+ "-a",
268
+ "--max-line-length=100"
269
+ ],
270
+ ```
271
+
272
+ ## Getting help
273
+
274
+ ➡️ [Join our Discord](https://discord.gg/pipecat)
275
+
276
+ ➡️ [Reach us on Twitter](https://x.com/pipecat_ai)