@nomad-e/bluma-cli 0.0.26 → 0.0.27
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/dist/main.js +11 -14
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1830,23 +1830,20 @@ var Agent = class {
|
|
|
1830
1830
|
const nativeToolInvoker = new ToolInvoker();
|
|
1831
1831
|
this.mcpClient = new MCPClient(nativeToolInvoker, eventBus2);
|
|
1832
1832
|
this.feedbackSystem = new AdvancedFeedbackSystem();
|
|
1833
|
-
const
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
|
|
1833
|
+
const endpoint = process.env.AZURE_OPENAI_ENDPOINT;
|
|
1834
|
+
const apiKey = process.env.AZURE_OPENAI_API_KEY;
|
|
1835
|
+
const apiVersion = process.env.AZURE_OPENAI_API_VERSION;
|
|
1836
|
+
this.deploymentName = process.env.AZURE_OPENAI_DEPLOYMENT || "";
|
|
1837
|
+
if (!endpoint || !apiKey || !apiVersion || !this.deploymentName) {
|
|
1838
|
+
const errorMessage = `Uma ou mais vari\xE1veis de ambiente Azure OpenAI n\xE3o foram encontradas. Verifique em: ${globalEnvPath} ou nas vari\xE1veis de sistema.`;
|
|
1839
|
+
throw new Error(errorMessage);
|
|
1837
1840
|
}
|
|
1838
|
-
this.deploymentName = modelName;
|
|
1839
1841
|
this.client = new OpenAI({
|
|
1840
|
-
// Configuração do cliente OpenAI hospedado no
|
|
1842
|
+
// Configuração do cliente OpenAI hospedado no Azure
|
|
1841
1843
|
apiKey,
|
|
1842
|
-
baseURL:
|
|
1843
|
-
|
|
1844
|
-
defaultHeaders: {
|
|
1845
|
-
"HTTP-Referer": "http://localhost:3000",
|
|
1846
|
-
// Substitua pelo seu site ou app
|
|
1847
|
-
"X-Title": "Bluma CLI Agent"
|
|
1848
|
-
// Substitua pelo nome do seu projeto
|
|
1849
|
-
}
|
|
1844
|
+
baseURL: `${endpoint}/openai/deployments/${this.deploymentName}`,
|
|
1845
|
+
defaultQuery: { "api-version": apiVersion },
|
|
1846
|
+
defaultHeaders: { "api-key": apiKey }
|
|
1850
1847
|
});
|
|
1851
1848
|
}
|
|
1852
1849
|
/**
|