generated from intersystems-community/intersystems-iris-dev-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8bd174
commit 9beac87
Showing
22 changed files
with
499 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# numpy==1.23.4 | ||
# pandas==1.5.0 | ||
# pandas==1.5.0 | ||
requests==2.31.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Class dc.irisMediCopilot.interop.bp.Speach Extends Ens.BusinessProcessBPL | ||
{ | ||
|
||
/// BPL Definition | ||
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' > | ||
|
||
<call name='Call API' target='OpenAi.BusinessOperation' async='1' xpos='200' ypos='350' > | ||
<request type='St.OpenAi.Msg.Audio.AudioRequest' > | ||
<assign property="callrequest" value="context.audioRequest" action="set" /> | ||
</request> | ||
<response type='St.OpenAi.Msg.Audio.AudioResponse' > | ||
<assign property="context.audioResponse" value="callresponse" action="set" /> | ||
</response> | ||
</call> | ||
<sync name='Wait Call APi' calls='Call API' type='all' xpos='200' ypos='450' /> | ||
</sequence> | ||
</process> | ||
} | ||
|
||
Storage Default | ||
{ | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Class dc.irisMediCopilot.interop.bp.Voice Extends Ens.BusinessProcessBPL | ||
{ | ||
|
||
/// 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' > | ||
<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' > | ||
<request type='Telegram.Request' > | ||
<assign property="callrequest" value="request" action="set" /> | ||
</request> | ||
<response type='dc.irisMediCopilot.interop.msg.resp.Voice' > | ||
</response> | ||
</call> | ||
</sequence> | ||
</process> | ||
} | ||
|
||
Storage Default | ||
{ | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...diCopilot/interop/MessageTransformDTL.cls → ...iCopilot/interop/dtl/MessageTransform.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Class dc.irisMediCopilot.interop.dtl.VoiceToOpenAi Extends Ens.DataTransformDTL [ DependsOn = (dc.irisMediCopilot.interop.msg.resp.Voice, St.OpenAi.Msg.Audio.AudioRequest) ] | ||
{ | ||
|
||
Parameter IGNOREMISSINGSOURCE = 1; | ||
|
||
Parameter REPORTERRORS = 1; | ||
|
||
Parameter TREATEMPTYREPEATINGFIELDASNULL = 0; | ||
|
||
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='"transcription"' property='target.Operation' action='set' /> | ||
<assign value='"json"' property='target.ResponseFormat' action='set' /> | ||
</transform> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Class dc.irisMediCopilot.interop.dtl.VoiceTransform Extends Ens.DataTransformDTL [ DependsOn = (Telegram.JSONContainer, Telegram.Request) ] | ||
{ | ||
|
||
Parameter IGNOREMISSINGSOURCE = 1; | ||
|
||
Parameter REPORTERRORS = 1; | ||
|
||
Parameter TREATEMPTYREPEATINGFIELDASNULL = 0; | ||
|
||
XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] | ||
{ | ||
<transform sourceClass='Telegram.JSONContainer' targetClass='Telegram.Request' create='new' language='objectscript' > | ||
<assign value='{}' property='target.Data' action='set' /> | ||
<assign value='source.Data.message.chat.id' property='target.Data."chat_id"' action='set' /> | ||
<assign value='source.Data.message.voice."file_id" ' property='target.Data."file_id"' action='set' /> | ||
<assign value='source.Data.message."message_id"' property='target.Data."reply_to_message_id"' action='set' /> | ||
</transform> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Class dc.irisMediCopilot.interop.msg.req.Audio Extends (Ens.Request, %JSON.Adaptor) | ||
{ | ||
|
||
/// File id of the audio voice on Telegram | ||
Property FileId As %String(%JSONFIELDNAME = "fileId"); | ||
|
||
/// Base64 of the audio to transcript/translate | ||
Property Audio As %String(%JSONFIELDNAME = "audio", MAXLEN = ""); | ||
|
||
/// Type of file. (flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.) | ||
Property Type As %String(%JSONFIELDNAME = "type", MAXLEN = "", VALUELIST = ",flac,mp3,mp4,mpeg,mpga,m4a,ogg,wav,webm") [ Required ]; | ||
|
||
/// Language to translate the audio | ||
Property Language As %String(%JSONFIELDNAME = "lang", MAXLEN = 3); | ||
|
||
/// Retrieve all the info about the audio or only the text | ||
Property FullInfo As %Boolean(%JSONFIELDNAME = "fullInfo"); | ||
|
||
/// Operation | ||
Property Operation As %String(%JSONINCLUDE = "none") [ InitialExpression = "transcription" ]; | ||
|
||
Storage Default | ||
{ | ||
<Data name="AudioRequestDefaultData"> | ||
<Subscript>"AudioRequest"</Subscript> | ||
<Value name="1"> | ||
<Value>Audio</Value> | ||
</Value> | ||
<Value name="2"> | ||
<Value>Language</Value> | ||
</Value> | ||
<Value name="3"> | ||
<Value>FullInfo</Value> | ||
</Value> | ||
<Value name="4"> | ||
<Value>Operation</Value> | ||
</Value> | ||
<Value name="5"> | ||
<Value>FileName</Value> | ||
</Value> | ||
<Value name="6"> | ||
<Value>Type</Value> | ||
</Value> | ||
<Value name="7"> | ||
<Value>FileId</Value> | ||
</Value> | ||
</Data> | ||
<DefaultData>AudioRequestDefaultData</DefaultData> | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Class dc.irisMediCopilot.interop.msg.req.Prompt Extends (Ens.Request, %JSON.Adaptor) | ||
{ | ||
|
||
Property Prompt As %String(%JSONFIELDNAME = "prompt", MAXLEN = ""); | ||
|
||
Property MaxTokens As %Integer(%JSONFIELDNAME = "max_tokens"); | ||
|
||
Property Model As %String(%JSONFIELDNAME = "model", MAXLEN = ""); | ||
|
||
Storage Default | ||
{ | ||
<Data name="ChatRequestDefaultData"> | ||
<Subscript>"ChatRequest"</Subscript> | ||
<Value name="1"> | ||
<Value>Prompt</Value> | ||
</Value> | ||
<Value name="2"> | ||
<Value>MaxTokens</Value> | ||
</Value> | ||
<Value name="3"> | ||
<Value>Model</Value> | ||
</Value> | ||
</Data> | ||
<DefaultData>ChatRequestDefaultData</DefaultData> | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Class dc.irisMediCopilot.interop.msg.req.Voice Extends (Ens.Request, %JSON.Adaptor) | ||
{ | ||
|
||
/// Telgram Chat Id | ||
Property ChatId As %Integer(%JSONFIELDNAME = "chat_id"); | ||
|
||
/// File id of the audio voice on Telegram | ||
Property FileId As %String(%JSONFIELDNAME = "file_id", MAXLEN = 1000); | ||
|
||
/// Telegram Token | ||
Property Token As %String(%JSONFIELDNAME = "token", MAXLEN = 1000); | ||
|
||
/// File type. (flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.) Default: "ogg" | ||
Property Type As %String(%JSONFIELDNAME = "type", MAXLEN = "", VALUELIST = ",flac,mp3,mp4,mpeg,mpga,m4a,ogg,wav,webm") [ InitialExpression = "ogg" ]; | ||
|
||
Storage Default | ||
{ | ||
<Data name="VoiceDefaultData"> | ||
<Subscript>"Voice"</Subscript> | ||
<Value name="1"> | ||
<Value>FileId</Value> | ||
</Value> | ||
<Value name="2"> | ||
<Value>Token</Value> | ||
</Value> | ||
<Value name="3"> | ||
<Value>ChatId</Value> | ||
</Value> | ||
<Value name="4"> | ||
<Value>Type</Value> | ||
</Value> | ||
</Data> | ||
<DefaultData>VoiceDefaultData</DefaultData> | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class dc.irisMediCopilot.interop.msg.resp.Audio Extends (Ens.Response, %JSON.Adaptor) | ||
{ | ||
|
||
Property Task As %String(%JSONFIELDNAME = "task", MAXLEN = ""); | ||
|
||
Property Language As %String(%JSONFIELDNAME = "language", MAXLEN = ""); | ||
|
||
Property Duration As %Decimal(%JSONFIELDNAME = "duration"); | ||
|
||
Property Text As %String(%JSONFIELDNAME = "text", MAXLEN = ""); | ||
|
||
Storage Default | ||
{ | ||
<Data name="AudioResponseDefaultData"> | ||
<Subscript>"AudioResponse"</Subscript> | ||
<Value name="1"> | ||
<Value>Task</Value> | ||
</Value> | ||
<Value name="2"> | ||
<Value>Language</Value> | ||
</Value> | ||
<Value name="3"> | ||
<Value>Duration</Value> | ||
</Value> | ||
<Value name="4"> | ||
<Value>Text</Value> | ||
</Value> | ||
</Data> | ||
<DefaultData>AudioResponseDefaultData</DefaultData> | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Class dc.irisMediCopilot.interop.msg.resp.Prompt Extends (Ens.Response, %JSON.Adaptor) | ||
{ | ||
|
||
Property Content As %String(%JSONFIELDNAME = "content", MAXLEN = ""); | ||
|
||
Storage Default | ||
{ | ||
<Data name="ChatResponseDefaultData"> | ||
<Subscript>"ChatResponse"</Subscript> | ||
<Value name="1"> | ||
<Value>Content</Value> | ||
</Value> | ||
</Data> | ||
<DefaultData>ChatResponseDefaultData</DefaultData> | ||
<Type>%Storage.Persistent</Type> | ||
} | ||
|
||
} |
Oops, something went wrong.