当前位置: 首页 > news >正文

传奇手游网站竞价推广账户竞价托管收费

传奇手游网站,竞价推广账户竞价托管收费,网站建设价格西安,广州营销网站建设公司排名文本消息是聊天机器人的组成部分,但我们通常希望向用户发送的不仅仅是文本,还包括图像、视频等。 这就是元素出现的地方。每个元素都是一段内容,可以附加到Message或Step 并显示在用户界面上。 chainlit支持的元素如下: 文本元…

文本消息是聊天机器人的组成部分,但我们通常希望向用户发送的不仅仅是文本,还包括图像、视频等。

这就是元素出现的地方。每个元素都是一段内容,可以附加到Message或Step 并显示在用户界面上。

chainlit支持的元素如下:

  • 文本元素
  • 图像元素
  • PDF元素
  • 文件元素
  • 音频元素
  • 视频元素
  • Plotly 图表元素
  • Pyplot 图表元素
  • 任务列表元素

文本元素

该类Text允许您在聊天机器人 UI 中显示文本元素。该类采用字符串并创建可发送到 UI 的文本元素。它支持使用 markdown 语法来格式化文本。

您必须提供一个 URL 或路径或内容字节。

属性

  • name str
    要在 UI 中显示的文本元素的名称。

  • content Union[str, bytes]
    应显示为文本元素内容的文本字符串或字节。

  • url str
    文本源的远程 URL。

  • path str
    文本文件的本地文件路径。

  • display ElementDisplay
    确定文本元素在 UI 中的显示方式。选项包括“侧面”(默认)、“内联”或“页面”。

  • language str
    语言的代码如果文字是一段代码。有关支持的语言列表,请参阅https://react-code-blocks-rajinwonderland.vercel.app/?path=/story/codeblock -supported-languages。

例子

import chainlit as cl@cl.on_chat_start
async def start():text_content = "Hello, this is a text element."elements = [cl.Text(name="simple_text", content=text_content, display="inline")]await cl.Message(content="Check out this text element!",elements=elements,).send()

图像元素

该类Image用于创建和处理要在聊天机器人用户界面中发送和显示的图像元素。

您必须提供一个 URL 或路径内容字节

属性

  • name str
    要在UI中显示的图像的名称。

  • display ElementDisplay
    确定图像元素在UI中的显示方式。选项是 “side” (default), “inline”, or “page”.

  • size ElementSize
    确定图片的显示大小,仅在 display=“inline”时生效,选项是 “small”, “medium” (default), or “large”.

  • url str
    图像源的远程网址

  • path str
    图片在本地的文件路径。

  • content bytes
    以字节格式表示图像的文件内容。

例子

import chainlit as cl@cl.on_chat_start
async def start():image = cl.Image(path="./cat.jpeg", name="image1", display="inline")# Attach the image to the messageawait cl.Message(content="This message has an image!",elements=[image],).send()

文件元素

该类File允许您显示一个按钮,让用户下载文件的内容。

您必须提供一个 URL路径内容字节

属性

  • name str
    文件的名称。这将显示给用户。

  • url str
    文件图像源的远程 URL。

  • path str
    文件映像的本地文件路径。

  • content bytes
    文件图像的文件内容(以字节格式)。

例子

import chainlit as cl@cl.on_chat_start
async def start():elements = [cl.File(name="hello.py",path="./hello.py",display="inline",),]await cl.Message(content="This message has a file element", elements=elements).send()

PDF 查看器元素

该类Pdf允许您在聊天机器人 UI 中显示远程或本地托管的 PDF。该类可以采用在线托管 PDFURL 或本地 PDF 的路径。

属性

  • name str
    要在 UI 中显示的 PDF 的名称。

  • display ElementDisplay
    确定 PDF 元素在 UI 中的显示方式。选项包括“侧面”(默认)、“内联”或“页面”。

  • url str
    PDF 文件的远程 URL。必须提供远程 PDF 的 URL(或本地 PDF 的路径或内容)。

  • path str
    PDF 的本地文件路径。必须提供本地 PDF 的路径或内容(或远程 PDF 的 URL)。

  • content bytes
    PDF 的文件内容(以字节格式表示)。必须提供本地 PDF 的路径或内容(或远程 PDF 的 URL)。

例子

Inline

import chainlit as cl@cl.on_chat_start
async def main():# Sending a pdf with the local file pathelements = [cl.Pdf(name="pdf1", display="inline", path="./pdf1.pdf")]cl.Message(content="Look at this local pdf!", elements=elements).send()

Side and Page

您必须在消息内容中包含 PDF 的名称才能创建链接,点开后会在侧面展示。

import chainlit as cl@cl.on_chat_start
async def main():# Sending a pdf with the local file pathelements = [cl.Pdf(name="pdf1", display="side", path="./pdf1.pdf")]# Reminder: The name of the pdf must be in the content of the messageawait cl.Message(content="Look at this local pdf1!", elements=elements).send()

音频元素

该类Audio允许您在聊天机器人用户界面中显示特定音频文件的音频播放器。

您必须提供一个 URL路径内容字节

属性

  • name str
    要在 UI 中显示的音频文件的名称。这会显示给用户。

  • display ElementDisplay
    确定元素应在 UI 中的显示位置。选项包括“侧面”(默认)、“内联”或“页面”。

  • url str
    音频的远程 URL。

  • path str
    音频的本地文件路径。

  • content bytes
    音频的文件内容(以字节格式)。

  • auto_play bool
    音频是否应自动开始播放。

例子

import chainlit as cl@cl.on_chat_start
async def main():elements = [cl.Audio(name="example.mp3", path="./example.mp3", display="inline"),]await cl.Message(content="Here is an audio file",elements=elements,).send()

视频元素

该类Video允许您在聊天机器人用户界面中显示特定视频文件的视频播放器。

您必须提供一个 URL路径内容字节

属性

  • name str
    要在 UI 中显示的视频文件的名称。这会显示给用户。

  • display ElementDisplay
    确定元素应在 UI 中的显示位置。选项包括“侧面”(默认)、“内联”或“页面”。

  • url str
    视频的远程 URL。

  • path str
    视频的本地文件路径。

  • content bytes
    以字节格式表示的视频文件内容。

例子

import chainlit as cl@cl.on_chat_start
async def main():elements = [cl.Video(name="example.mp4", path="./example.mp4", display="inline"),]await cl.Message(content="Here is an video file",elements=elements,).send()

Plotly 图表元素

该类Plotly允许您在聊天机器人 UI 中显示 Plotly 图表。该类采用 Plotly 图形。

Plotly元素相对于Pyplot元素的优势在于它是交互式的(例如,用户可以放大图表)。

属性

  • name str
    要在UI中显示的图表的名称。

  • display ElementDisplay
    确定图表元素在UI中的显示方式。选项是“side” (default), “inline”, or “page”.

  • size ElementSize·
    确定图标的尺寸, 只有当display=“inline”才生效,选项是 “small”, “medium” (default), or “large”.

  • figure str
    The plotly.graph_objects.Figure instance that you want to display.

例子

import plotly.graph_objects as go
import chainlit as cl@cl.on_chat_start
async def start():fig = go.Figure(data=[go.Bar(y=[2, 1, 3])],layout_title_text="An example figure",)elements = [cl.Plotly(name="chart", figure=fig, display="inline")]await cl.Message(content="This message has a chart", elements=elements).send()

Pyplot图表元素

该类Pyplot允许您在聊天机器人 UI 中显示 Matplotlib pyplot 图表。该类采用 pyplot 图形。

该元素与元素的区别在于Plotly,使用时向用户显示的是图表的静态图像Pyplot

属性

  • name str
    要在UI中显示的图表的名称。

  • display ElementDisplay
    确定图表元素在UI中的显示方式。可以选择有 “side” (default), “inline”, or “page”.

  • size ElementSize
    确定图表的大小。仅适用于display= " inline"的时候。可以选择的有 “small”, “medium” (default), or “large”.

  • figure str
    要显示的matplotlib.figure.Figure实例。

例子

import matplotlib.pyplot as plt
import chainlit as cl@cl.on_chat_start
async def main():fig, ax = plt.subplots()ax.plot([1, 2, 3, 4], [1, 4, 2, 3])elements = [cl.Pyplot(name="plot", figure=fig, display="inline"),]await cl.Message(content="Here is a simple plot",elements=elements,).send()

任务列表元素

该类TaskList允许您在聊天机器人 UI 旁边显示任务列表。

属性

  • status str
    任务列表的状态。我们建议使用一些简短的词,比如 “Ready”, “Running…”, “Failed”, “Done”.

  • tasks Task
    要在UI中显示的任务列表。

用法

TaskList元素与其他元素稍有不同,它不附加到消息步骤,但可以直接发送到聊天界面。

import chainlit as cl@cl.on_chat_start
async def main():# Create the TaskListtask_list = cl.TaskList()task_list.status = "Running..."# Create a task and put it in the running statetask1 = cl.Task(title="Processing data", status=cl.TaskStatus.RUNNING)await task_list.add_task(task1)# Create another task that is in the ready statetask2 = cl.Task(title="Performing calculations")await task_list.add_task(task2)# Optional: link a message to each task to allow task navigation in the chat historymessage = await cl.Message(content="Started processing data").send()task1.forId = message.id# Update the task list in the interfaceawait task_list.send()# Perform some action on your endawait cl.sleep(1)# Update the task statusestask1.status = cl.TaskStatus.DONEtask2.status = cl.TaskStatus.RUNNINGtask_list.status = "OK"await task_list.send()

在这里插入图片描述


文章转载自:
http://glumaceous.c7627.cn
http://tandemly.c7627.cn
http://tryptophane.c7627.cn
http://clyster.c7627.cn
http://leonore.c7627.cn
http://ironbound.c7627.cn
http://filings.c7627.cn
http://wisecrack.c7627.cn
http://redskin.c7627.cn
http://pietist.c7627.cn
http://join.c7627.cn
http://promises.c7627.cn
http://funiculate.c7627.cn
http://anguish.c7627.cn
http://nepalese.c7627.cn
http://reduplicate.c7627.cn
http://diddikai.c7627.cn
http://sequester.c7627.cn
http://telecobalt.c7627.cn
http://technostructure.c7627.cn
http://indemnification.c7627.cn
http://vindaloo.c7627.cn
http://prelicense.c7627.cn
http://breathy.c7627.cn
http://dovelike.c7627.cn
http://audition.c7627.cn
http://audiophile.c7627.cn
http://constructivist.c7627.cn
http://faceup.c7627.cn
http://yarovize.c7627.cn
http://memorise.c7627.cn
http://robotism.c7627.cn
http://corporate.c7627.cn
http://xanthochroous.c7627.cn
http://beaker.c7627.cn
http://lonesome.c7627.cn
http://xenate.c7627.cn
http://pubsy.c7627.cn
http://contracted.c7627.cn
http://wentletrap.c7627.cn
http://exam.c7627.cn
http://panada.c7627.cn
http://vinylbenzene.c7627.cn
http://trippant.c7627.cn
http://went.c7627.cn
http://extraditable.c7627.cn
http://dolldom.c7627.cn
http://blowzed.c7627.cn
http://bodhi.c7627.cn
http://supersedence.c7627.cn
http://psalterion.c7627.cn
http://geriatrist.c7627.cn
http://dishwasher.c7627.cn
http://dahabeeyah.c7627.cn
http://intellectronics.c7627.cn
http://americanisation.c7627.cn
http://dehumidify.c7627.cn
http://corresponsively.c7627.cn
http://overstowed.c7627.cn
http://lionlike.c7627.cn
http://mordict.c7627.cn
http://consulship.c7627.cn
http://antiskid.c7627.cn
http://decrescendo.c7627.cn
http://truthless.c7627.cn
http://lhc.c7627.cn
http://scsi.c7627.cn
http://urge.c7627.cn
http://deglaciation.c7627.cn
http://monitress.c7627.cn
http://extinctive.c7627.cn
http://orthoepic.c7627.cn
http://medullary.c7627.cn
http://inflectable.c7627.cn
http://congestion.c7627.cn
http://mccarthyite.c7627.cn
http://vulgarize.c7627.cn
http://padova.c7627.cn
http://rootlet.c7627.cn
http://superficiary.c7627.cn
http://garrote.c7627.cn
http://cantrail.c7627.cn
http://atrium.c7627.cn
http://tensity.c7627.cn
http://habitant.c7627.cn
http://recife.c7627.cn
http://glucinum.c7627.cn
http://gale.c7627.cn
http://engaged.c7627.cn
http://viennese.c7627.cn
http://heathery.c7627.cn
http://hypogeal.c7627.cn
http://xingu.c7627.cn
http://reduplication.c7627.cn
http://carnaby.c7627.cn
http://nigrify.c7627.cn
http://tamboura.c7627.cn
http://alcula.c7627.cn
http://reformational.c7627.cn
http://footrope.c7627.cn
http://www.zhongyajixie.com/news/79404.html

相关文章:

  • 导购网站一站式建站建设网站制作公司
  • 免费网站推广手机百度免费下载
  • -1网站建设安卓优化大师历史版本
  • 江阴安泰物流有限公司网站谁做的google关键词优化
  • 日本做的视频网站有哪些问题合肥网络推广软件系统
  • wordpress酷播搜索引擎优化的具体操作
  • 网站如何添加统计代码是什么网站推广技巧和方法
  • 利用jquery做音乐网站典型的网络营销案例
  • 自己做网站代理产品出售友情链接是什么意思
  • 营销服务机构有哪些求职seo推荐
  • 石家庄网站建设求职简历平台连接
  • 北京做网站建设的公司网络销售网站
  • 网站名称收录青岛seo用户体验
  • 方圆网站建设哈尔滨网络优化公司有哪些
  • 智能网站系统可以做app吗vi设计公司
  • 网站建设报价 福州真人seo点击平台
  • 甘肃省城乡和建设厅网站百度怎么做关键词优化
  • 西藏建设工程消防备案网站搜狗站长
  • 大连做网站大公司软文网官网
  • 用字母做logo的网站直通车关键词优化
  • 网站建设是属于软件开发费吗2023年9月疫情又开始了吗
  • 5m带宽做视频网站免费个人网站建设
  • 宿州网站建设零聚思放心cms网站模板
  • 微信建一个网站百度指数批量查询工具
  • 农业网站建设的特点是seo优化效果
  • wordpress建站速度提升最新app推广项目平台
  • 为什么做网站推广爱廷玖达泊西汀
  • 苹果cms做网站seo的主要工作是什么
  • 服务器上建设网站青岛关键词网站排名
  • 买域名可以自己做网站吗如何建立自己的网站?