[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]Identity Support with Azure OpenAI to eliminate plan password #3595

Open
georgehu0815 opened this issue Nov 27, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@georgehu0815
Copy link

Describe the feature you'd like
Instead of using plan text password, we need support identity. Following is the example.

A clear and concise description of what you would like Flowise to have.
import { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity";
import { AzureOpenAI } from "openai";
import "dotenv/config.js";

const credential = new DefaultAzureCredential();
const scope = "https://cognitiveservices.azure.com/.default";

const azureADTokenProvider = getBearerTokenProvider(credential, scope);
// You will need to set these environment variables or edit the following values
const endpoint =  "https://*.openai.azure.com/";  
const apiVersion = "2024-05-01-preview";  
const deployment = "gpt-4o"; // This must match your deployment name

const AZURE_OPENAI_ENDPOINT = process.env["AZURE_OPENAI_ENDPOINT"] || endpoint;
const AZURE_OPENAI_VERSION = process.env["AZURE_OPENAI_VERSION"] || apiVersion;
const AZURE_OPENAI_DEPLOYMENT = process.env["AZURE_OPENAI_DEPLOYMENT"] || deployment;
const MODEL = process.env["model"] || "gpt-4o";
console.log("==endpoint: ",AZURE_OPENAI_ENDPOINT);
console.log("==version: ",AZURE_OPENAI_VERSION);
console.log("==deploy: ",AZURE_OPENAI_DEPLOYMENT);
console.log("==model: ",MODEL);

export  async function main_llm() {
    const options = { azureADTokenProvider:azureADTokenProvider, deployment: AZURE_OPENAI_DEPLOYMENT,apiVersion: AZURE_OPENAI_VERSION ,endpoint: AZURE_OPENAI_ENDPOINT};
    const client = new AzureOpenAI(options);
    return client;

}
module.exports = { main_llm }; // CommonJS export

Additional context
Add any other context or screenshots about the feature request here.

@diptesh-bose
Copy link

Yes, very important for Enterprise Management

@HenryHengZJ HenryHengZJ added the enhancement New feature or request label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants