AlbertRapp / tidychatmodels

Chat With All Kinds of AI Models Through a Common Interface
https://tidychatmodels.albert-rapp.de/
Other
118 stars 10 forks source link

Support Azure openAI deployments #2

Open AlbertRapp opened 8 months ago

AlbertRapp commented 8 months ago

The goal is to support Azure openAI deployments

JamesHWade commented 8 months ago

Great package! Really like your approach. I see you self-assigned Azure OpenAI. If you haven't started on this yet, would you mind if I contributed a PR? I've implemented it for some other packages, and there are some specifics to it that aren't very well documented.

JamesHWade commented 8 months ago

Along those same lines, what do you think about S3 for create_chat? I could see it getting a bit cumbersome as more services get added.

AlbertRapp commented 8 months ago

Hey James 👋 I self-assigned all issues just because....well really there's no particulary good reason :D So go for it, thank you :)

Btw, I imagined that to support Azure openAI only the url in create_chat() would need to be changed using the resource group and deployment name. From a usability perspective I wonder whether adding a whole bunch of more arguments to create_chat() is a great idea. Maybe one could incorporate additional information into an argument called config_list where the docs state what additional named entries the list would need to have depending on the vendor. Maybe one could even create a bunch of helpers like config_list_*() that has the necessary arguments, e.g. config_list_azure(resource_group_url, deployment_name).

Ahh your next comment just came in as I was typing this. I would prefer using such a functional approach rather than an object-oriented approach. How do you feel about this? Do you see more advantages of going S3? (To be honest, I'm not so well-versed in OO and I feel like a functional approach is more R-centric. So that's my prefered solution but I can be convinced otherwise)

AlbertRapp commented 8 months ago

Hmm now that I think about this more, I'm not quite sure what the advantages of S3 are (sorry not well-versed with OO) 😄. I believe the things with config_list_*() would only change the user-facing syntax and behind the scenes it can still be S3, right? 🤔

JamesHWade commented 8 months ago

I'll give the azure openai implementation a try with config_list_azure(). I can separately create a draft S3 implementation to see if you think it would be useful. No worries if you stick with functional approach (that's typically my bias, too).

JiaZhang42 commented 7 months ago

Thank you for the great package, Albert! As a user in one of the banned countries, I'm really looking forward to the Azure OpenAI support.