frames: generate protobuf pb2 file for pipecat package

This commit is contained in:
Aleix Conchillo Flaqué
2024-05-29 10:33:23 -07:00
parent 02191b7d58
commit d8b483dc1e
3 changed files with 20 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
BSD 2-Clause License BSD 2-Clause License
Copyright (c) 2024, Kwindla Hultman Kramer Copyright (c) 2024, Daily
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:

View File

@@ -4,28 +4,32 @@
// SPDX-License-Identifier: BSD 2-Clause License // SPDX-License-Identifier: BSD 2-Clause License
// //
// Generate frames_pb2.py with:
//
// python -m grpc_tools.protoc --proto_path=./ --python_out=./protobufs frames.proto
syntax = "proto3"; syntax = "proto3";
package pipecat_proto; package pipecat;
message TextFrame { message TextFrame {
string text = 1; string text = 1;
} }
message AudioFrame { message AudioRawFrame {
bytes data = 1; bytes audio = 1;
} }
message TranscriptionFrame { message TranscriptionFrame {
string text = 1; string text = 1;
string participantId = 2; string user_id = 2;
string timestamp = 3; string timestamp = 3;
} }
message Frame { message Frame {
oneof frame { oneof frame {
TextFrame text = 1; TextFrame text = 1;
AudioFrame audio = 2; AudioRawFrame audio = 2;
TranscriptionFrame transcription = 3; TranscriptionFrame transcription = 3;
} }
} }

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: frames.proto # source: frames.proto
# Protobuf Python Version: 4.25.3 # Protobuf Python Version: 4.25.1
"""Generated protocol buffer code.""" """Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import descriptor_pool as _descriptor_pool
@@ -14,19 +14,19 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x66rames.proto\x12\rpipecat_proto\"\x19\n\tTextFrame\x12\x0c\n\x04text\x18\x01 \x01(\t\"\x1a\n\nAudioFrame\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"L\n\x12TranscriptionFrame\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x15\n\rparticipantId\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\t\"\xa2\x01\n\x05\x46rame\x12(\n\x04text\x18\x01 \x01(\x0b\x32\x18.pipecat_proto.TextFrameH\x00\x12*\n\x05\x61udio\x18\x02 \x01(\x0b\x32\x19.pipecat_proto.AudioFrameH\x00\x12:\n\rtranscription\x18\x03 \x01(\x0b\x32!.pipecat_proto.TranscriptionFrameH\x00\x42\x07\n\x05\x66rameb\x06proto3') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x66rames.proto\x12\x07pipecat\"\x19\n\tTextFrame\x12\x0c\n\x04text\x18\x01 \x01(\t\"\x1e\n\rAudioRawFrame\x12\r\n\x05\x61udio\x18\x01 \x01(\x0c\"F\n\x12TranscriptionFrame\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\t\"\x93\x01\n\x05\x46rame\x12\"\n\x04text\x18\x01 \x01(\x0b\x32\x12.pipecat.TextFrameH\x00\x12\'\n\x05\x61udio\x18\x02 \x01(\x0b\x32\x16.pipecat.AudioRawFrameH\x00\x12\x34\n\rtranscription\x18\x03 \x01(\x0b\x32\x1b.pipecat.TranscriptionFrameH\x00\x42\x07\n\x05\x66rameb\x06proto3')
_globals = globals() _globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'frames_pb2', _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'frames_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False: if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None DESCRIPTOR._options = None
_globals['_TEXTFRAME']._serialized_start=31 _globals['_TEXTFRAME']._serialized_start=25
_globals['_TEXTFRAME']._serialized_end=56 _globals['_TEXTFRAME']._serialized_end=50
_globals['_AUDIOFRAME']._serialized_start=58 _globals['_AUDIORAWFRAME']._serialized_start=52
_globals['_AUDIOFRAME']._serialized_end=84 _globals['_AUDIORAWFRAME']._serialized_end=82
_globals['_TRANSCRIPTIONFRAME']._serialized_start=86 _globals['_TRANSCRIPTIONFRAME']._serialized_start=84
_globals['_TRANSCRIPTIONFRAME']._serialized_end=162 _globals['_TRANSCRIPTIONFRAME']._serialized_end=154
_globals['_FRAME']._serialized_start=165 _globals['_FRAME']._serialized_start=157
_globals['_FRAME']._serialized_end=327 _globals['_FRAME']._serialized_end=304
# @@protoc_insertion_point(module_scope) # @@protoc_insertion_point(module_scope)