Skip to content

Commit

Permalink
🐛 Fix sync BP 2 Bo
Browse files Browse the repository at this point in the history
  • Loading branch information
henryhamon committed May 3, 2024
1 parent 9421651 commit 88dd464
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/dc/irisMediCopilot/interop/Production.cls
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ XData ProductionDefinition
<Setting Target="Adapter" Name="FilesSave">file</Setting>
<Setting Target="Adapter" Name="Token">Token</Setting>
</Item>

<Item Name="Message.Router" Category="" ClassName="EnsLib.MsgRouter.RoutingEngine" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
<Setting Target="Host" Name="BusinessRuleName">dc.irisMediCopilot.interop.rule.FilterMessage</Setting>
</Item>
<Item Name="SpeechToText.Process" Category="" ClassName="dc.irisMediCopilot.interop.bp.Speach" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
</Item>

<Item Name="TelegramVoice.Process" Category="" ClassName="dc.irisMediCopilot.interop.bp.Voice" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
<Setting Target="Host" Name="BusinessRuleName">dc.irisMediCopilot.interop.rule.SpeechToText</Setting>
<Setting Target="Host" Name="ResponseTargetConfigNames">SpeechToText.Router</Setting>
</Item>

<Item Name="SpeechToText.Process" Category="" ClassName="dc.irisMediCopilot.interop.bp.Speach" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
</Item>

<Item Name="VoiceFile.Router" Category="" ClassName="EnsLib.MsgRouter.RoutingEngine" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
Expand Down
1 change: 0 additions & 1 deletion src/dc/irisMediCopilot/interop/bp/Speach.cls
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl" ]
<process language='objectscript' request='Telegram.Request' response='dc.irisMediCopilot.interop.msg.resp.Audio' height='2000' width='2000' >
<context>
<property name='audioRequest' type='St.OpenAi.Msg.Audio.AudioRequest' instantiate='0' />
<property name='audioResponse' type='St.OpenAi.Msg.Audio.AudioResponse' instantiate='0' />
</context>
<sequence xend='200' yend='650' >

Expand Down
22 changes: 15 additions & 7 deletions src/dc/irisMediCopilot/interop/bp/Voice.cls
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
///
Class dc.irisMediCopilot.interop.bp.Voice Extends Ens.BusinessProcessBPL
{

Storage Default
{
<Type>%Storage.Persistent</Type>
}

/// BPL Definition
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl" ]
{
<process language='objectscript' request='Telegram.Request' response='St.OpenAi.Msg.Audio.AudioResponse' height='2000' width='2000' >
<process language='objectscript' request='Telegram.Request' response='dc.irisMediCopilot.interop.msg.resp.Voice' height='2000' width='2000' >
<context>
<property name='voiceResponse' type='dc.irisMediCopilot.interop.msg.resp.Voice' instantiate='0' />
<property name='audioRequest' type='St.OpenAi.Msg.Audio.AudioRequest' instantiate='0' />
</context>
<sequence xend='200' yend='650' >
<call name='Get Voice' target='VoiceFile.BusinessOperation' async='1' xpos='200' ypos='250' >
<call name='Get Voice' target='VoiceFile.BusinessOperation' async='0' xpos='200' ypos='250' >
<request type='Telegram.Request' >
<assign property="callrequest" value="request" action="set" />
</request>
<response type='dc.irisMediCopilot.interop.msg.resp.Voice' >
<assign property="context.voiceResponse" value="callresponse" action="set" />
</response>
</call>
<call name='Call Speech2Text' target='SpeechToText.Router' async='1' xpos='200' ypos='450' >
<request type='dc.irisMediCopilot.interop.msg.resp.Voice' >
<assign property="callrequest" value="context.voiceResponse" action="set" />
</request>
</call>
<sync name='Wait Voice' calls='Get Voice,Call Speech2Text' type='all' xpos='200' ypos='550' />
</sequence>
</process>
}

Storage Default
{
<Type>%Storage.Persistent</Type>
}

}
2 changes: 1 addition & 1 deletion src/dc/irisMediCopilot/interop/dtl/VoiceToOpenAi.cls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='dc.irisMediCopilot.interop.msg.resp.Voice' targetClass='St.OpenAi.Msg.Audio.AudioRequest' create='new' language='objectscript' >
<assign value='source.Audio' property='target.Audio' action='set' />
<assign value='source.Type' property='target.Type' action='set' />
<assign value='"mp3"' property='target.Type' action='set' />
<assign value='"transcription"' property='target.Operation' action='set' />
<assign value='"json"' property='target.ResponseFormat' action='set' />
</transform>
Expand Down
2 changes: 1 addition & 1 deletion src/dc/irisMediCopilot/interop/msg/resp/Voice.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Class dc.irisMediCopilot.interop.msg.resp.Voice Extends (Ens.Request, %JSON.Adap
{

/// Base64 of the audio to transcript/translate
Property Audio As %String(%JSONFIELDNAME = "audio", MAXLEN = "") [ Required ];
Property Audio As %String(%JSONFIELDNAME = "audio", MAXLEN = "");

/// Telgram Chat Id
Property ChatId As %Integer(%JSONFIELDNAME = "chat_id");
Expand Down

0 comments on commit 88dd464

Please sign in to comment.