Skip to content

Commit

Permalink
Misc fixes and cleanups (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
keepingitneil authored Nov 29, 2023
1 parent 0e8cb63 commit 1527206
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/publish-livekit-plugins-anthropic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Publish livekit-plugins-anthropic

on:
workflow_dispatch

jobs:
call-publish-workflow:
uses: ./.github/workflows/publish-package.yml
with:
package_name: 'livekit-plugins/livekit-plugins-anthropic'
secrets: inherit
1 change: 0 additions & 1 deletion livekit-plugins/livekit-plugins-anthropic/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
include=["livekit.*"]),
python_requires=">=3.7.0",
install_requires=[
"livekit >= 0.5.0",
"anthropic >= 0.7.5",
],
package_data={},
Expand Down
1 change: 0 additions & 1 deletion livekit-plugins/livekit-plugins-google/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
include=["livekit.*"]),
python_requires=">=3.7.0",
install_requires=[
"livekit",
"numpy >= 1.24.0",
"google-api-core >= 2.11.1",
"google-auth >= 2.23.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import numpy as np
from typing import AsyncIterator
from openai import AsyncOpenAI
from PIL import Image
from livekit import rtc


Expand All @@ -37,15 +36,15 @@ async def generate_image_from_prompt(self, text: str) -> AsyncIterator[rtc.Video
quality="standard",
n=1)
image_url = response.data[0].url
image = await asyncio.get_event_loop().run_in_executor(None, self.fetch_image, image_url)
image = await asyncio.get_event_loop().run_in_executor(None, self._fetch_image, image_url)
argb_array = bytearray(image.tobytes())

argb_frame = rtc.ArgbFrame.create(
rtc.VideoFormatType.FORMAT_ARGB, image.shape[0], image.shape[1])
argb_frame.data[:] = argb_array
return rtc.VideoFrame(0, rtc.VideoRotation.VIDEO_ROTATION_0, argb_frame.to_i420())

def fetch_image(self, url):
def _fetch_image(self, url):
response = requests.get(url, timeout=10)
arr = np.asarray(bytearray(response.content), dtype=np.uint8)
img = cv2.imdecode(arr, cv2.IMREAD_COLOR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.0.7"
__version__ = "0.0.8"
2 changes: 1 addition & 1 deletion livekit-plugins/livekit-plugins-openai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
include=["livekit.*"]),
python_requires=">=3.7.0",
install_requires=[
"livekit >= 0.5.0",
"livekit",
"torch >= 2.1.0",
"numpy >= 1.24.0",
"openai >= 0.28.0",
Expand Down

0 comments on commit 1527206

Please sign in to comment.