Comments (3)
Reopening this because prompt playground
is a very useful feature which does not work with Azure OpenAI yet. Any hints how to solve it?
Please see below:
openai.error.InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>
Simply you need to pass that environmental variables to openai.ChatCompletion.create
in case of Azure OpenAI API
:
# Other env variables
openai.api_type = "azure"
openai.api_key ="<KEY>"
openai.api_base = "<URL of Endpoint>"
openai.api_version = "2023-03-15-preview"
openai.ChatCompletion.create(
deployment_id=settings.azure_deployment_id,
model=model,
)
from chainlit.
For a quick local hack you can hardcode your deployment_id here https://github.com/Chainlit/chainlit/blob/main/src/chainlit/server.py#L91 in your local installation.
For the real fix, we need to enhance the prompt playground to make it more flexible and compatible with more LLMs.
from chainlit.
Nevermind
According to Langchain simply set the following env variables for embedding models:
os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_BASE"] = "https://<your-endpoint.openai.azure.com/"
os.environ["OPENAI_API_KEY"] = "your AzureOpenAI key"
os.environ["OPENAI_API_VERSION"] = "2023-03-15-preview"
and similarly for the chat_model
.
from chainlit.
Related Issues (20)
- Custom css doesn't affect copilot
- ChatProfile name cannot be obtained in Chinese HOT 1
- Adding Model Name (flexibility to add metadata ) with answer when using multi model chatbot like ChatGPT
- Can't Use Data Persistence With Oauth HOT 1
- localhost refused to connect
- Allow user session timeout to be configurable
- Access Token used in URL params
- Best way to make first screen have example queries HOT 1
- ua-parser-js license is not allowed HOT 3
- Avatars overwritten by ChatProfile icon HOT 2
- Play multiple `Audio` elements in sequence
- Saving metadata earlier in the chat
- How to use the new feature ssl-cert support?
- Function Calling on the website (no copilot)
- Step should nest under and after parent_id step/message HOT 1
- Message content not updating on message.update()
- Changing settings then pressing cancel changes the option on the UI
- Thread does not display: `Accessing 'participantIdentifier' is not allowed.` HOT 3
- httpcore.ConnectError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1135)
- How can I get the current theme used by Chainlit?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chainlit.