@cpwc/node-red-contrib-ai-intent 3.1.0-alpha → 3.1.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/azure-openai-chat/azure-openai-configuration/index.html +23 -0
- package/azure-openai-chat/azure-openai-configuration/index.js +8 -0
- package/azure-openai-chat/icons/chatgpt-icon.svg +7 -0
- package/azure-openai-chat/index.html +197 -0
- package/azure-openai-chat/index.js +68 -0
- package/constants.js +2 -0
- package/openai-response/index.html +6 -6
- package/openai-response/index.js +8 -4
- package/package.json +3 -1
- package/utilities/chat-ledger.js +1 -1
@@ -0,0 +1,23 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
RED.nodes.registerType('azure-openai-configuration', {
|
3
|
+
category: 'config',
|
4
|
+
defaults: {
|
5
|
+
api: { value: "", required: true },
|
6
|
+
endpoint: { value: "", required: true }
|
7
|
+
},
|
8
|
+
label: function () {
|
9
|
+
return "Azure OpenAI API Token"
|
10
|
+
}
|
11
|
+
});
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script type="text/html" data-template-name="azure-openai-configuration">
|
15
|
+
<div class="form-row">
|
16
|
+
<label for="node-config-input-api"><i class="fa fa-bookmark"></i> API Token</label>
|
17
|
+
<input type="text" id="node-config-input-api">
|
18
|
+
</div>
|
19
|
+
<div class="form-row">
|
20
|
+
<label for="node-config-input-endpoint"><i class="fa fa-bookmark"></i> Endpoint</label>
|
21
|
+
<input type="text" id="node-config-input-endpoint">
|
22
|
+
</div>
|
23
|
+
</script>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
4
|
+
<g>
|
5
|
+
<path d="M423.895,220.444C432.789,193.751 429.726,164.509 415.503,140.229C394.114,102.988 351.116,83.829 309.122,92.845C290.44,71.799 263.6,59.831 235.461,60.002C192.536,59.904 154.45,87.541 141.244,128.383C113.669,134.03 89.866,151.291 75.938,175.755C54.39,212.898 59.302,259.718 88.09,291.569C79.196,318.262 82.259,347.504 96.481,371.784C117.87,409.025 160.868,428.184 202.862,419.168C221.531,440.214 248.384,452.182 276.523,451.999C319.472,452.109 357.571,424.448 370.776,383.569C398.351,377.922 422.154,360.661 436.082,336.197C457.606,299.054 452.681,252.271 423.905,220.42L423.895,220.444ZM276.549,426.383C259.362,426.407 242.714,420.393 229.52,409.38C230.12,409.061 231.162,408.486 231.835,408.069L309.894,362.988C313.888,360.722 316.338,356.471 316.313,351.877L316.313,241.833L349.303,260.882C349.658,261.054 349.891,261.397 349.94,261.789L349.94,352.919C349.892,393.442 317.073,426.297 276.549,426.383ZM118.717,358.97C110.105,344.098 107.006,326.666 109.958,309.748C110.534,310.091 111.551,310.716 112.273,311.132L190.332,356.213C194.289,358.528 199.189,358.528 203.158,356.213L298.453,301.185L298.453,339.283C298.478,339.675 298.294,340.055 297.988,340.3L219.084,385.859C183.938,406.096 139.053,394.067 118.73,358.97L118.717,358.97ZM98.173,188.581C106.748,173.685 120.285,162.292 136.406,156.375C136.406,157.049 136.369,158.237 136.369,159.07L136.369,249.244C136.344,253.826 138.795,258.076 142.776,260.343L238.071,315.359L205.081,334.408C204.75,334.628 204.334,334.665 203.966,334.506L125.05,288.91C89.978,268.599 77.948,223.726 98.161,188.593L98.173,188.581ZM369.222,251.657L273.927,196.629L306.917,177.592C307.248,177.372 307.664,177.335 308.032,177.494L386.948,223.053C422.082,243.352 434.124,288.298 413.825,323.432C405.238,338.304 391.713,349.696 375.604,355.626L375.604,262.757C375.641,258.175 373.203,253.937 369.234,251.658L369.222,251.658L369.222,251.657ZM402.053,202.24C401.477,201.885 400.461,201.272 399.738,200.856L321.679,155.775C317.722,153.46 312.822,153.46 308.853,155.775L213.558,210.803L213.558,172.705C213.534,172.313 213.717,171.933 214.023,171.688L292.927,126.166C328.073,105.892 373.007,117.958 393.269,153.117C401.832,167.964 404.931,185.347 402.028,202.241L402.053,202.241L402.053,202.24ZM195.624,270.143L162.622,251.094C162.267,250.923 162.034,250.58 161.985,250.188L161.985,159.058C162.01,118.485 194.926,85.605 235.499,85.63C252.662,85.63 269.273,91.657 282.467,102.633C281.867,102.951 280.838,103.527 280.152,103.944L202.093,149.025C198.099,151.291 195.649,155.53 195.674,160.124L195.625,270.119L195.625,270.143L195.624,270.143ZM213.546,231.506L255.993,206.993L298.44,231.494L298.44,280.507L255.993,305.008L213.546,280.507L213.546,231.506Z" style="fill:white;fill-rule:nonzero;"/>
|
6
|
+
</g>
|
7
|
+
</svg>
|
@@ -0,0 +1,197 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
(() => {
|
3
|
+
const DYNAMIC_OPTIONS = [
|
4
|
+
{ value: "auto", label: "Automatic" },
|
5
|
+
{ value: "none", label: "None" }
|
6
|
+
]
|
7
|
+
|
8
|
+
const removeDuplicates = (data) => {
|
9
|
+
const intents = {}
|
10
|
+
const tools = []
|
11
|
+
|
12
|
+
data.forEach((intent => {
|
13
|
+
if (intent.type === "OpenAI Tool") {
|
14
|
+
if (!intents[intent.name]) {
|
15
|
+
intents[intent.name] = true
|
16
|
+
tools.push(intent)
|
17
|
+
}
|
18
|
+
} else {
|
19
|
+
tools.push(intent)
|
20
|
+
}
|
21
|
+
}))
|
22
|
+
return tools
|
23
|
+
}
|
24
|
+
$.getJSON('registered-intents', function (data = RED.settings.callIntentRegistry) {
|
25
|
+
const tools = removeDuplicates(data)
|
26
|
+
window.__tools = getToolOptions(tools)
|
27
|
+
initialize()
|
28
|
+
});
|
29
|
+
|
30
|
+
const getToolOptions = (intents = []) => {
|
31
|
+
const options = intents.map(intent => {
|
32
|
+
const suffix = intent.type === "Register Intent" ? " (Registered Intent)" : ""
|
33
|
+
return { value: intent.id, label: `${intent.name}${suffix}` }
|
34
|
+
})
|
35
|
+
|
36
|
+
return [...DYNAMIC_OPTIONS, ...options]
|
37
|
+
}
|
38
|
+
|
39
|
+
RED.nodes.registerType("Azure OpenAI Chat", {
|
40
|
+
category: 'AI Intent',
|
41
|
+
color: 'rgba(255, 0, 119, .75)',
|
42
|
+
icon: "chatgpt-icon.svg",
|
43
|
+
defaults: {
|
44
|
+
name: { value: "" },
|
45
|
+
tool_choice: {
|
46
|
+
value: getToolOptions(RED.settings.callIntentRegistry),
|
47
|
+
},
|
48
|
+
conversation_id: { value: "" },
|
49
|
+
token: { value: "", type: "azure-openai-configuration", required: false },
|
50
|
+
model: { value: "gpt-4o", required: true },
|
51
|
+
temperature: { value: .7, required: true },
|
52
|
+
max_tokens: { value: 1200, required: true },
|
53
|
+
top_p: { value: 1, required: true },
|
54
|
+
frequency_penalty: { value: 0, required: true },
|
55
|
+
presence_penalty: { value: 0, required: true },
|
56
|
+
},
|
57
|
+
inputs: 1,
|
58
|
+
outputs: 1,
|
59
|
+
paletteLabel: "Azure OpenAI (Deprecated)",
|
60
|
+
label: function () {
|
61
|
+
return this.name ? `${this.name} (Deprecated)` : "Azure OpenAI (Deprecated)";
|
62
|
+
},
|
63
|
+
|
64
|
+
oneditprepare: function (x) {
|
65
|
+
$("#node-input-temperature").typedInput({
|
66
|
+
type: "num",
|
67
|
+
})
|
68
|
+
$("#node-input-max_tokens").typedInput({
|
69
|
+
type: "num",
|
70
|
+
})
|
71
|
+
$("#node-input-top_p").typedInput({
|
72
|
+
type: "num",
|
73
|
+
})
|
74
|
+
$("#node-input-frequency_penalty").typedInput({
|
75
|
+
type: "num",
|
76
|
+
})
|
77
|
+
$("#node-input-presence_penalty").typedInput({
|
78
|
+
type: "num",
|
79
|
+
})
|
80
|
+
|
81
|
+
$.getJSON('registered-intents', function (data = RED.settings.callIntentRegistry) {
|
82
|
+
const tools = removeDuplicates(data)
|
83
|
+
window.__tools = getToolOptions(tools)
|
84
|
+
|
85
|
+
$("#node-input-tool_choice").typedInput({
|
86
|
+
types: [
|
87
|
+
{
|
88
|
+
value: "",
|
89
|
+
options: window.__tools
|
90
|
+
}
|
91
|
+
]
|
92
|
+
})
|
93
|
+
});
|
94
|
+
}
|
95
|
+
});
|
96
|
+
})()
|
97
|
+
|
98
|
+
</script>
|
99
|
+
|
100
|
+
<script type="text/html" data-template-name="Azure OpenAI Chat">
|
101
|
+
<div class="form-row">
|
102
|
+
<label for="node-input-name"> Name</label>
|
103
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
104
|
+
</div>
|
105
|
+
<div class="form-row">
|
106
|
+
<label for="node-input-token"> Token</label>
|
107
|
+
<input type="text" id="node-input-token" placeholder="0a1b2c3b4d5e6f">
|
108
|
+
</div>
|
109
|
+
<div class="form-row">
|
110
|
+
<label for="node-input-conversation_id"><i class="fa fa-tag"></i> Conversation Id</label>
|
111
|
+
<input type="text" id="node-input-conversation_id" placeholder="any arbitrary name">
|
112
|
+
</div>
|
113
|
+
<div class="form-row">
|
114
|
+
<label for="node-input-model"> Model</label>
|
115
|
+
<input type="text" id="node-input-model" placeholder="gpt-3.5-turbo">
|
116
|
+
</div>
|
117
|
+
<div class="form-row">
|
118
|
+
<label for="node-input-tool_choice"> Tool Choice</label>
|
119
|
+
<input type="text" id="node-input-tool_choice" placeholder="Automatic">
|
120
|
+
</div>
|
121
|
+
<div class="form-row">
|
122
|
+
<label for="node-input-temperature"> Temperature</label>
|
123
|
+
<input type="number" id="node-input-temperature" placeholder="0.7">
|
124
|
+
</div>
|
125
|
+
<div class="form-row">
|
126
|
+
<label for="node-input-max_tokens"> Max Tokens</label>
|
127
|
+
<input type="number" id="node-input-max_tokens" placeholder="1200">
|
128
|
+
</div>
|
129
|
+
<div class="form-row">
|
130
|
+
<label for="node-input-top_p"> Top P</label>
|
131
|
+
<input type="number" id="node-input-top_p" placeholder="0">
|
132
|
+
</div>
|
133
|
+
<div class="form-row">
|
134
|
+
<label for="node-input-frequency_penalty"> Frequency Penalty</label>
|
135
|
+
<input type="number" id="node-input-frequency_penalty" placeholder="0">
|
136
|
+
</div>
|
137
|
+
<div class="form-row">
|
138
|
+
<label for="node-input-presence_penalty"> Presence Penalty</label>
|
139
|
+
<input type="number" id="node-input-presence_penalty" placeholder="0">
|
140
|
+
</div>
|
141
|
+
|
142
|
+
</script>
|
143
|
+
|
144
|
+
<script type="text/html" data-help-name="Azure OpenAI Chat">
|
145
|
+
<p>Calls Azure OpenAI and returns the response</p>
|
146
|
+
|
147
|
+
<h3>Important</h3>
|
148
|
+
<p>To use this node you need an API key and endpoint from Azure OpenAI. Add the API key and endpoint to the settings.js file in the node-red folder under
|
149
|
+
the functonGlobalContext section using the key "openaiAPIKey" and "azureOpenAIEndpoint"</p>
|
150
|
+
<pre>
|
151
|
+
functionGlobalContext: {
|
152
|
+
openaiAPIKey: "Your API key goes here",
|
153
|
+
azureOpenAIEndpoint: "Your endpoint goes here"
|
154
|
+
}
|
155
|
+
</pre>
|
156
|
+
|
157
|
+
Alternatively, you can add the token via the token configuration dropdown.
|
158
|
+
See the <a href="https://github.com/montaque22/node-red-contrib-ai-intent" target="_blank">Read Me</a> for more information
|
159
|
+
|
160
|
+
<h3>Inputs</h3>
|
161
|
+
<dl class="message-properties">
|
162
|
+
<dt class="optional">Conversation ID
|
163
|
+
<span class="property-type">string</span>
|
164
|
+
</dt>
|
165
|
+
<dd> By including this identifier, AI-Intent will save the conversation in the global context
|
166
|
+
and will pass the entire conversation to the LLM when any Chat node with the same conversation id
|
167
|
+
is triggered. This mean that you can have many Chat nodes in different flows with the same conversation id
|
168
|
+
and AI-Intent will ensure that conversation context is maintained between them. It should be noted that only
|
169
|
+
<b>one</b> System message will be maintained. As a result the flow with the current System node will
|
170
|
+
overwrite any system prompt that was previously saved.</dd>
|
171
|
+
</dl>
|
172
|
+
<dl class="message-properties">
|
173
|
+
<dt class="required">model
|
174
|
+
<span class="property-type">string</span>
|
175
|
+
</dt>
|
176
|
+
<dd> Required field that dictates the model to use when calling OpenAI </dd>
|
177
|
+
</dl>
|
178
|
+
<dl class="message-properties">
|
179
|
+
<dt class="required">Tool Choice
|
180
|
+
<span class="property-type">Dropdown</span>
|
181
|
+
</dt>
|
182
|
+
<dd> This setting controls whether or not GPT uses the provided functions to respond.
|
183
|
+
If you want to force GPT to use a specific function, selected it from the dropdown.
|
184
|
+
<b>Automatic</b> lets GPT decides what is best (This is the default). <b>None</b> disables the use of functions.
|
185
|
+
to further optimize the API call, AI-Intent will not pass any of the tools
|
186
|
+
to save tokens if "None" is selected. Check documentation for more detail on
|
187
|
+
how tools work: <a href="https://cookbook.openai.com/examples/how_to_call_functions_with_chat_models" target="_blank">Function Calling & Tools</a>
|
188
|
+
</dd>
|
189
|
+
</dl>
|
190
|
+
|
191
|
+
<p>To learn more about the other properties, look at <a target="_blank" href="https://platform.openai.com/docs/api-reference/chat/create">OpenAI's documentation</a></p>
|
192
|
+
|
193
|
+
<h3>Details</h3>
|
194
|
+
<p>At minimum the User node should be used before this node. The OpenAI User node adds necessary
|
195
|
+
information to the msg object to allow the chat to work.</p>
|
196
|
+
|
197
|
+
</script>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
const AzureOpenAI = require("openai");
|
2
|
+
const { OPEN_AI_KEY, TYPES, AZURE_OPENAI_ENDPOINT } = require("../constants");
|
3
|
+
const { end } = require("../globalUtils");
|
4
|
+
const { ChatController } = require("../utilities/chat-controller");
|
5
|
+
const { GlobalContext } = require("../utilities/global-context");
|
6
|
+
|
7
|
+
module.exports = function (RED) {
|
8
|
+
function AzureOpenAIChatHandlerNode(config) {
|
9
|
+
RED.nodes.createNode(this, config);
|
10
|
+
// Retrieve the config node with API token data.
|
11
|
+
this.token = RED.nodes.getNode(config.token);
|
12
|
+
const node = this;
|
13
|
+
this.on("input", function (msg, send, done = () => { }) {
|
14
|
+
const controller = new ChatController(node, config, msg, RED);
|
15
|
+
const nodeDB = new GlobalContext(node);
|
16
|
+
const apiKey =
|
17
|
+
node.token?.api || nodeDB.getValueFromGlobalContext(OPEN_AI_KEY);
|
18
|
+
const endpoint =
|
19
|
+
node.token?.endpoint || nodeDB.getValueFromGlobalContext(AZURE_OPENAI_ENDPOINT);
|
20
|
+
const apiVersion = "2025-01-01-preview";
|
21
|
+
|
22
|
+
send =
|
23
|
+
send ||
|
24
|
+
function () {
|
25
|
+
config.send.apply(node, arguments);
|
26
|
+
};
|
27
|
+
|
28
|
+
if (!apiKey) {
|
29
|
+
return end(
|
30
|
+
done,
|
31
|
+
"API key missing for Azure OpenAI. Please add openaiAPIKey key-value pair to the functionGlobalContext."
|
32
|
+
);
|
33
|
+
}
|
34
|
+
if (!endpoint) {
|
35
|
+
return end(
|
36
|
+
done,
|
37
|
+
"Endpoint missing for Azure OpenAI. Please add azureOpenAIEndpoint key-value pair to the functionGlobalContext."
|
38
|
+
);
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
const { apiProperties, toolProperties } = controller;
|
43
|
+
const openai = new OpenAI({ endpoint, apiKey, apiVersion });
|
44
|
+
const finalProps = {
|
45
|
+
...toolProperties,
|
46
|
+
model: apiProperties.model,
|
47
|
+
messages: apiProperties.messages,
|
48
|
+
temperature: apiProperties.temperature,
|
49
|
+
max_tokens: apiProperties.max_tokens,
|
50
|
+
top_p: apiProperties.top_p,
|
51
|
+
frequency_penalty: apiProperties.frequency_penalty,
|
52
|
+
presence_penalty: apiProperties.presence_penalty,
|
53
|
+
};
|
54
|
+
|
55
|
+
openai.chat.completions
|
56
|
+
.create(finalProps)
|
57
|
+
.then((answer) => {
|
58
|
+
send(controller.mergeResponseWithMessage(answer, finalProps));
|
59
|
+
end(done);
|
60
|
+
})
|
61
|
+
.catch((err) => {
|
62
|
+
end(done, err);
|
63
|
+
});
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
RED.nodes.registerType(TYPES.AzureOpenAIChat, AzureOpenAIChatHandlerNode);
|
68
|
+
};
|
package/constants.js
CHANGED
@@ -5,9 +5,11 @@ module.exports = {
|
|
5
5
|
INTENT_STORE: "intent_store",
|
6
6
|
ACTIVE_CONVERSATION: "active_conversation_context",
|
7
7
|
CONVERSATION_CONTEXT: "conversation_context",
|
8
|
+
AZURE_OPENAI_ENDPOINT: "azure_openai_endpoint",
|
8
9
|
TYPES: {
|
9
10
|
RegisterIntent: "Register Intent",
|
10
11
|
CallIntent: "Call Intent",
|
12
|
+
AzureOpenAIChat: "Azure OpenAI Chat",
|
11
13
|
OpenAIChat: "OpenAI Chat",
|
12
14
|
LLMChat: "LLM Chat",
|
13
15
|
LocalAIChat: "LocalAI Chat",
|
@@ -2,11 +2,11 @@
|
|
2
2
|
RED.nodes.registerType("OpenAI Response", {
|
3
3
|
category: 'AI Intent',
|
4
4
|
color: 'rgba(255, 0, 119, .5)',
|
5
|
-
icon:"font-awesome/fa-commenting-o",
|
5
|
+
icon: "font-awesome/fa-commenting-o",
|
6
6
|
defaults: {
|
7
7
|
name: { value: "" },
|
8
|
-
keepFormatting: {value: false},
|
9
|
-
clearConversation: {value: false}
|
8
|
+
keepFormatting: { value: false },
|
9
|
+
clearConversation: { value: false }
|
10
10
|
},
|
11
11
|
inputs: 1,
|
12
12
|
outputs: 1,
|
@@ -15,8 +15,8 @@
|
|
15
15
|
return this.name ? `${this.name} (Deprecated)` : "Response (Deprecated)";
|
16
16
|
},
|
17
17
|
|
18
|
-
oneditprepare: function(x){
|
19
|
-
|
18
|
+
oneditprepare: function (x) {
|
19
|
+
|
20
20
|
}
|
21
21
|
});
|
22
22
|
|
@@ -63,4 +63,4 @@
|
|
63
63
|
If the previous Chat node in the flow has a conversation id, then this node will clean up after
|
64
64
|
it and delete the any saved conversation under the given <pre>conversation_id</pre>. This option can be
|
65
65
|
dynamically triggered by setting **msg.clearConversation** to <pre>`true`</pre>
|
66
|
-
</script>
|
66
|
+
</script>
|
package/openai-response/index.js
CHANGED
@@ -34,7 +34,7 @@ module.exports = function (RED) {
|
|
34
34
|
const { message } = msg.payload;
|
35
35
|
const output = [];
|
36
36
|
|
37
|
-
if(message.tool_calls){
|
37
|
+
if (message.tool_calls) {
|
38
38
|
message.tool_calls.forEach((answer) => {
|
39
39
|
|
40
40
|
const payload = createConsistentPayload(answer.content);
|
@@ -53,12 +53,12 @@ module.exports = function (RED) {
|
|
53
53
|
}
|
54
54
|
});
|
55
55
|
}
|
56
|
-
else{
|
56
|
+
else {
|
57
57
|
output.push(createConsistentPayload(message.content));
|
58
58
|
}
|
59
59
|
|
60
60
|
return output
|
61
|
-
};
|
61
|
+
};
|
62
62
|
const formatPayloadForOpenAI = (msg) => {
|
63
63
|
const output = [];
|
64
64
|
// Goes through the OpenAI Response and creates a standard uniformed output
|
@@ -111,7 +111,7 @@ module.exports = function (RED) {
|
|
111
111
|
return output;
|
112
112
|
};
|
113
113
|
|
114
|
-
this.on("input", function (msg, send, done = () => {}) {
|
114
|
+
this.on("input", function (msg, send, done = () => { }) {
|
115
115
|
send =
|
116
116
|
send ||
|
117
117
|
function () {
|
@@ -121,6 +121,10 @@ module.exports = function (RED) {
|
|
121
121
|
msg.originalResponse = msg.payload;
|
122
122
|
|
123
123
|
switch (msg._debug.type) {
|
124
|
+
case TYPES.AzureOpenAIChat: {
|
125
|
+
msg.payload = formatPayloadForOpenAI(msg);
|
126
|
+
break;
|
127
|
+
}
|
124
128
|
case TYPES.OpenAIChat: {
|
125
129
|
msg.payload = formatPayloadForOpenAI(msg);
|
126
130
|
break;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cpwc/node-red-contrib-ai-intent",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.2-alpha",
|
4
4
|
"description": "A collection of nodes to elevate a user's automation interactions",
|
5
5
|
"scripts": {
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
@@ -19,6 +19,7 @@
|
|
19
19
|
"geminiai-chat": "geminiai-chat/index.js",
|
20
20
|
"localai-chat": "localai-chat/index.js",
|
21
21
|
"openai-chat": "openai-chat/index.js",
|
22
|
+
"azure-openai-chat": "azure-openai-chat/index.js",
|
22
23
|
"openai-system": "openai-system/index.js",
|
23
24
|
"openai-tool": "openai-tool/index.js",
|
24
25
|
"openai-user": "openai-user/index.js",
|
@@ -28,6 +29,7 @@
|
|
28
29
|
"register-intent": "register-intent/index.js",
|
29
30
|
"platform-configuration": "llm-chat/platform-configuration/index.js",
|
30
31
|
"openai-configuration": "openai-chat/openai-configuration/index.js",
|
32
|
+
"azure-openai-configuration": "azure-openai-chat/azure-openai-configuration/index.js",
|
31
33
|
"localai-configuration": "localai-chat/localai-configuration/index.js",
|
32
34
|
"geminiai-configuration": "geminiai-chat/geminiai-configuration/index.js"
|
33
35
|
}
|
package/utilities/chat-ledger.js
CHANGED
@@ -18,7 +18,7 @@ class ChatLedger {
|
|
18
18
|
conversation.push(message);
|
19
19
|
});
|
20
20
|
|
21
|
-
if (type === TYPES.OpenAIChat) {
|
21
|
+
if (type === TYPES.OpenAIChat || type === TYPES.AzureOpenAIChat) {
|
22
22
|
response.choices.forEach(({ message }) => {
|
23
23
|
const { role, content = "", tool_calls } = message;
|
24
24
|
|