From 37aabaa03a9548f7d4dce119c57716341fa623ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 29 May 2024 10:33:23 -0700 Subject: [PATCH] frames: generate protobuf pb2 file for pipecat package --- LICENSE | 2 +- src/pipecat/frames/frames.proto | 14 +++++++++----- src/pipecat/frames/protobufs/frames_pb2.py | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/LICENSE b/LICENSE index b60f5327e..cd6220df2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ 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 modification, are permitted provided that the following conditions are met: diff --git a/src/pipecat/frames/frames.proto b/src/pipecat/frames/frames.proto index 18e59e492..69ac1d460 100644 --- a/src/pipecat/frames/frames.proto +++ b/src/pipecat/frames/frames.proto @@ -4,28 +4,32 @@ // 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"; -package pipecat_proto; +package pipecat; message TextFrame { string text = 1; } -message AudioFrame { - bytes data = 1; +message AudioRawFrame { + bytes audio = 1; } message TranscriptionFrame { string text = 1; - string participantId = 2; + string user_id = 2; string timestamp = 3; } message Frame { oneof frame { TextFrame text = 1; - AudioFrame audio = 2; + AudioRawFrame audio = 2; TranscriptionFrame transcription = 3; } } diff --git a/src/pipecat/frames/protobufs/frames_pb2.py b/src/pipecat/frames/protobufs/frames_pb2.py index bdc34d385..5df1c34a2 100644 --- a/src/pipecat/frames/protobufs/frames_pb2.py +++ b/src/pipecat/frames/protobufs/frames_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: frames.proto -# Protobuf Python Version: 4.25.3 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor 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() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'frames_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _globals['_TEXTFRAME']._serialized_start=31 - _globals['_TEXTFRAME']._serialized_end=56 - _globals['_AUDIOFRAME']._serialized_start=58 - _globals['_AUDIOFRAME']._serialized_end=84 - _globals['_TRANSCRIPTIONFRAME']._serialized_start=86 - _globals['_TRANSCRIPTIONFRAME']._serialized_end=162 - _globals['_FRAME']._serialized_start=165 - _globals['_FRAME']._serialized_end=327 + _globals['_TEXTFRAME']._serialized_start=25 + _globals['_TEXTFRAME']._serialized_end=50 + _globals['_AUDIORAWFRAME']._serialized_start=52 + _globals['_AUDIORAWFRAME']._serialized_end=82 + _globals['_TRANSCRIPTIONFRAME']._serialized_start=84 + _globals['_TRANSCRIPTIONFRAME']._serialized_end=154 + _globals['_FRAME']._serialized_start=157 + _globals['_FRAME']._serialized_end=304 # @@protoc_insertion_point(module_scope)