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

feat: added Microsoft's Azure AI as a provider and cleaned up the list. #836

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aliasfoxkde
Copy link
Collaborator

Added Azure AI Provider which offers OpenAI GPT-4o model and others through GitHub PAT (Personal Access Token).

As required for adding a new provider, I modified the models.ts, constrants.ts, api-keys.ts, and .env.example files.

Added Provider: Microsoft's Azure AI

Key Changes

  • Alphabetized the Provider List Dropdown
  • Alphabetized the Provider List Case Statements for clarity
  • Added section to .env.example
  • Removed duplicates from constrants.ts for PROVIDER_LIST
  • Added only supported models that have been confirmed working with Provider:
    OpenAI GPT-4o, OpenAI GPT-4o mini, Cohere Command R+, Mistral Large, Mistral Nemo, and Mistral Small
  • Added required endpoint and code (across files) for the provider

Testing

  • Fully tested response from each model
  • Confirm that changes worked with latest version

Migration Impact

  • Breaking Changes: None.
  • Migration Steps: None required.
  • Backward Compatibility: Fully backward compatible.

Future Improvements

  • Add additional models to the given provider as they are confirmed to be working.

image

@aliasfoxkde aliasfoxkde added cleanup Cleaning of the pull request is need model-provider This is a model provider addition labels Dec 19, 2024
@aliasfoxkde aliasfoxkde changed the title Added Microsoft's Azure AI as a Provider and cleaned up the list. feat: Added Microsoft's Azure AI as a Provider and cleaned up the list. Dec 19, 2024
@aliasfoxkde aliasfoxkde changed the title feat: Added Microsoft's Azure AI as a Provider and cleaned up the list. feat: added Microsoft's Azure AI as a provider and cleaned up the list. Dec 19, 2024
@aliasfoxkde aliasfoxkde self-assigned this Dec 19, 2024
@thecodacus
Copy link
Collaborator

shall we wait for the provider refactor?
by the way model names how do you define it. as far as i know it is custom on azure deployment portal. and can be anything.
depending on what the user has setup there

@aliasfoxkde
Copy link
Collaborator Author

Yeah, assuming #832 gets merged, I'll readdress this after with the new structure. And Azure/Microsoft/GitHub has several models by different providers. Namely OpenAI, Cohere, Meta, Mistral, and Phi. It's a bit unclear tbh, and their documentation isn't great.

@Cloudinfo-Github
Copy link

thanks for add this function ,but I have some problem, use docker
error message:
Cannot read properties of undefined (reading 'toolCalls')
at Object.flush (file:///app/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ai/core/generate-text/stream-text.ts:569:33)
at invokePromiseCallback (node:internal/webstreams/util:181:10)
at Object. (node:internal/webstreams/util:186:23)
at transformStreamDefaultSinkCloseAlgorithm (node:internal/webstreams/transformstream:613:43)
at node:internal/webstreams/transformstream:371:11
at writableStreamDefaultControllerProcessClose (node:internal/webstreams/writablestream:1153:28)
at writableStreamDefaultControllerAdvanceQueueIfNeeded (node:internal/webstreams/writablestream:1233:5)
at writableStreamDefaultControllerClose (node:internal/webstreams/writablestream:1200:3)
at writableStreamClose (node:internal/webstreams/writablestream:713:3)
at writableStreamDefaultWriterClose (node:internal/webstreams/writablestream:1082:10)
at writableStreamDefaultWriterCloseWithErrorPropagation (node:internal/webstreams/writablestream:1074:10)
at node:internal/webstreams/readablestream:1550:15
at complete (node:internal/webstreams/readablestream:1429:9)
at processTicksAndRejections (node:internal/process/task_queues:95:5
Click outside, press Esc key, or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.

@thecodacus
Copy link
Collaborator

thanks for add this function ,but I have some problem, use docker error message: Cannot read properties of undefined (reading 'toolCalls') at Object.flush (file:///app/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ai/core/generate-text/stream-text.ts:569:33) at invokePromiseCallback (node:internal/webstreams/util:181:10) at Object. (node:internal/webstreams/util:186:23) at transformStreamDefaultSinkCloseAlgorithm (node:internal/webstreams/transformstream:613:43) at node:internal/webstreams/transformstream:371:11 at writableStreamDefaultControllerProcessClose (node:internal/webstreams/writablestream:1153:28) at writableStreamDefaultControllerAdvanceQueueIfNeeded (node:internal/webstreams/writablestream:1233:5) at writableStreamDefaultControllerClose (node:internal/webstreams/writablestream:1200:3) at writableStreamClose (node:internal/webstreams/writablestream:713:3) at writableStreamDefaultWriterClose (node:internal/webstreams/writablestream:1082:10) at writableStreamDefaultWriterCloseWithErrorPropagation (node:internal/webstreams/writablestream:1074:10) at node:internal/webstreams/readablestream:1550:15 at complete (node:internal/webstreams/readablestream:1429:9) at processTicksAndRejections (node:internal/process/task_queues:95:5 Click outside, press Esc key, or fix the code to dismiss. You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.

delete the node_modules folder and do a pnpm install

@thecodacus
Copy link
Collaborator

@aliasfoxkde , I tried to test but the get key long points to github
image

@aliasfoxkde
Copy link
Collaborator Author

You do get an access key through GitHub, but you can also get one through Microsoft.

@Cloudinfo-Github
Copy link

感謝您添加此函數,但我有一些問題,請使用 docker 錯誤消息:無法讀取 Object.flush (file:///app/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/ai/core/generate-text/stream-text.ts:569:33) 中 undefined (讀取'toolCalls') 的屬性 (node:internal/webstreams/util:181:10) 在 Object 的 invokePromiseCallback (node:internal/webstreams/util:181:10) 中。(node:internal/webstreams/util:186:23) 在 transformStreamDefaultSinkCloseAlgorithm (node:internal/webstreams/transformstream:613:43) 在 node:internal/webstreams/transformstream:371:11 在 writableStreamDefaultControllerProcessClose (node:internal/webstreams/writablestream:1153:28) 在 writableStreamDefaultControllerAdvanceQueueIfNeeded (node:internal/webstreams/writablestream:1233:5) 在 writableStreamDefaultControllerClose (node:internal/webstreams/writableStream:1200:3) 在 writableStreamClose (node:internal/webstreams/writablestream:713:3) 在 writableStreamDefaultWriterClose (node:internal/webstreams/writablestream:1082:10) 在 writableStreamDefaultWriterCloseWithErrorPropagation (node:internal/webstreams/writablestream:1074:10) 在 node:internal/webstreams/readablestream:1550:15 完成 (node:internal/webstreams/readablestream:1429:9) 在 processTicksAndRejections (node:internal/process/task_queues:95:5在外部按下,按 Esc 鍵,或修復代碼以關閉。您還可以通過在 vite.config.ts 中將 server.hmr.overlay 設置為 false 來禁用此疊加層。

刪除 node_modules資料夾並執行pnpm install

OK, I'll test it, thank you

@Cloudinfo-Github
Copy link

@thecodacus
I have tried it, but the problem is still the same, whether using direct testing or docker image.

@Cloudinfo-Github
Copy link

You do get an access key through GitHub, but you can also get one through Microsoft.

I later re-git cloned and installed it, but it seemed that I couldn't get the Azure AI api key. Where should I set it correctly? One is set in .env, and the other is set directly on the browser.

@thecodacus
Copy link
Collaborator

You do get an access key through GitHub, but you can also get one through Microsoft.

I later re-git cloned and installed it, but it seemed that I couldn't get the Azure AI api key. Where should I set it correctly? One is set in .env, and the other is set directly on the browser.

thsi PR is not merged yet once its merged you will be able to see the option. for now if you really want to test you can pull this PR. but would not recommend puling from PRs for a non technical user / or anything other than the purpose of testing

@Cloudinfo-Github
Copy link

You do get an access key through GitHub, but you can also get one through Microsoft.

I later re-git cloned and installed it, but it seemed that I couldn't get the Azure AI api key. Where should I set it correctly? One is set in .env, and the other is set directly on the browser.

thsi PR is not merged yet once its merged you will be able to see the option. for now if you really want to test you can pull this PR. but would not recommend puling from PRs for a non technical user / or anything other than the purpose of testing

At present, only Github's api key can be used in Azure AI after pulling the test, but it may be because it is free and there are very few tokens, so it timed out immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Cleaning of the pull request is need model-provider This is a model provider addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants