Fixes #100 Add explicit codable implementation to ChatMessage without removing the Identifiable conformance by implementing an explicit codable implementation that ignores the id property when encoding, and creates a new UUID when decoding.
This should fix the regular chat and streaming chat as both have not been working with the encoded id.
I've also added a new OpenAIEndpointModelType with the currently available OpenAI models, to replace the OpenAIModelType. The current OpenAIModelType model enum and methods that have models as parameters could easily cause errors as any model could be chosen for any of those methods. By adding the new OpenAIEndpointModel type that corresponds to the compatibility list in the OpenAI docs, it’s much easier to select the fitting model.
The new type does contain duplicate model strings, which is intended to make it easier to maintain.
Backward compatibility is assured by marking the previous methods as deprecated. and using the old methods as wrappers around the new methods.
Fixes #100
Add explicit codable implementation to ChatMessage
without removing theIdentifiable
conformance by implementing an explicit codable implementation that ignores theid
property when encoding, and creates a new UUID when decoding.This should fix the regular chat and streaming chat as both have not been working with the encoded
id
.I've also added a new
OpenAIEndpointModelType
with the currently available OpenAI models, to replace theOpenAIModelType
. The currentOpenAIModelType
model enum and methods that have models as parameters could easily cause errors as any model could be chosen for any of those methods. By adding the newOpenAIEndpointModel
type that corresponds to the compatibility list in the OpenAI docs, it’s much easier to select the fitting model. The new type does contain duplicate model strings, which is intended to make it easier to maintain.Backward compatibility is assured by marking the previous methods as deprecated. and using the old methods as wrappers around the new methods.