mirror of
https://github.com/rio-labs/rio.git
synced 2026-02-09 07:09:00 -06:00
bugfixes in chatbot snippets
This commit is contained in:
@@ -8,7 +8,7 @@ from io import BytesIO, StringIO
|
||||
from pathlib import Path
|
||||
from typing import * # type: ignore
|
||||
|
||||
import imy.asset_manager
|
||||
import imy.assets
|
||||
import imy.package_metadata
|
||||
from PIL.Image import Image
|
||||
from typing_extensions import Annotated
|
||||
@@ -45,7 +45,7 @@ Readonly = Annotated[T, _READONLY]
|
||||
ImageLike = Path | Image | URL | bytes
|
||||
|
||||
|
||||
ASSET_MANGER: imy.asset_manager.AssetManager = imy.asset_manager.AssetManager(
|
||||
ASSET_MANGER: imy.assets.AssetManager = imy.assets.AssetManager(
|
||||
xz_dir=RIO_ASSETS_DIR,
|
||||
cache_dir=USER_CACHE_DIR / "rio",
|
||||
version=imy.package_metadata.get_package_version("rio-ui"),
|
||||
@@ -130,12 +130,10 @@ class FileInfo:
|
||||
return self._contents.decode(encoding)
|
||||
|
||||
@overload
|
||||
async def open(self, type: Literal["r"]) -> StringIO:
|
||||
...
|
||||
async def open(self, type: Literal["r"]) -> StringIO: ...
|
||||
|
||||
@overload
|
||||
async def open(self, type: Literal["rb"]) -> BytesIO:
|
||||
...
|
||||
async def open(self, type: Literal["rb"]) -> BytesIO: ...
|
||||
|
||||
async def open(self, type: Literal["r", "rb"] = "r") -> StringIO | BytesIO:
|
||||
"""
|
||||
|
||||
@@ -82,22 +82,22 @@ class EmptyChatPlaceholder(rio.Component):
|
||||
),
|
||||
rio.Row(
|
||||
comps.ChatSuggestionCard(
|
||||
"restaurant",
|
||||
"material/restaurant",
|
||||
"Suggest ways to make a dish more delicious",
|
||||
on_press=self.on_question,
|
||||
),
|
||||
comps.ChatSuggestionCard(
|
||||
"coffee",
|
||||
"material/coffee",
|
||||
"What's the best way to store coffee?",
|
||||
on_press=self.on_question,
|
||||
),
|
||||
comps.ChatSuggestionCard(
|
||||
"co-present",
|
||||
"material/co-present",
|
||||
"Help me improve my presentation technique",
|
||||
on_press=self.on_question,
|
||||
),
|
||||
comps.ChatSuggestionCard(
|
||||
"work",
|
||||
"material/work",
|
||||
"Draft a job application email for me",
|
||||
on_press=self.on_question,
|
||||
),
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import KW_ONLY, field
|
||||
from datetime import datetime, timezone
|
||||
from typing import * # type: ignore
|
||||
|
||||
# <additional-imports>
|
||||
from datetime import datetime, timezone
|
||||
|
||||
import openai
|
||||
|
||||
import rio
|
||||
|
||||
Reference in New Issue
Block a user