Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitbucket.org/tsing-roo/async-chat-protos

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbucket.org/tsing-roo/async-chat-protos

  • v0.0.3
  • Source
  • Go
  • Socket score

Version published
Created
Source

异步耗时聊天服务 ptotos 定义

主要用于文生图、文生视频、联网查询以及其它类似的不能立刻给出回复的会话类型的通用协议定义
引入protos go get bitbucket.org/tsing-roo/async-chat-protos
主要的方法跟common-chat-protos类似,聊天grpc方法不一样
异步聊天(联网,文生图,文生视频)处理流程,以DALLE文生图为例
  • 1.Client端调用创建异步任务接口,应用调用Conversation接口,应用返回一个任务ID
  • 2.Client端拿着任务ID轮询任务状态和返回结果(为避免结果太多,可以采用某个策略过滤掉一些响应)

gRpc依赖和代码生成

  • 安装gRpc必须的protocprotoc-gen-goproto-gen-go-grpc
  • protos定义通用数据结构,各自子项目的model定义自己使用的具体的数据结构
  • 执行命令前先cd到v1目录,如果不存在asyncchatv1目录就创建
  • 根据proto生成代码命令参考: protoc --go-grpc_out=./asyncchatv1/ --go-grpc_opt=paths=source_relative --go_out=./asyncchatv1/ --go_opt=paths=source_relative ./*.proto

FAQs

Package last updated on 29 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc