Comments (3)
Thanks a lot for your time! I've just published this fix, it should be working out of the box.
from openai-functions.
Sorry for making you wait. I do not have access to the Azure OpenAI service, still tried to implement a fix, though. Can you confirm whether updating the package and passing in the engine
parameter (your deployment ID) into Conversation
or nlp
solves the issue?
from openai-functions.
Hey I was able to get this to work but with one catch.
openai.api_type = "azure"
openai.api_key = "..."
openai.api_base = "https://blabla.openai.azure.com"
openai.api_version = "2023-07-01-preview"
engine = "blabla"
conversation = openai_functions.Conversation(model="gpt-4", engine=engine)
There was an issue with Azure OpenAI implementation not returning the content field in messages. I had to make the below modification. Let me know if I'm using it wrong or should I open a PR for this.
# openai_types.py
class Message:
# more stuff
def __init__(
self,
message: MessageType | str,
role: Literal["system", "user", "assistant"] = "user",
):
if isinstance(message, str):
if role == "assistant": # We have to split this up because of mypy
self.message: MessageType = {"role": role, "content": message}
else:
self.message = {
"role": role,
"content": message,
}
else:
# NEW CODE
if "content" not in message:
message["content"] = None
# END NEW CODE
self.message = message
Sorry for sharing code in this barbaric manner I'm super busy at the moment.
from openai-functions.
Related Issues (4)
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 openai-functions.