spring-ai
spring-ai copied to clipboard
Revisit package structure in light of multiple model data types
Currently we have the structure
org.sf.ai.chat
org.sf.ai.prompt
org.sf.ai.prompt.messages
This doesn't feel right for several reasons. First is that message
package should not be under prompt
as it is more general and used in areas outside prompts, for example the Generation
class is of type message.
Message
, MessageType
and AbstractMessage
are very generic in the API, however AssistantMessage
, ChatMessage
and others are specific to "chat" AI models and should maybe be under the chat
package.
Furthermore, we want to support other models that take other types of input and output other than text type. For example, models that support text->image and image->image. Also there is the case of multimodal AI models that can text (text,image,video,audio) -> (text,image,video,audio)
To sort out the best package structure to "grow into over time" a spike should be done, at least with single "modal" model that have a different data type of input/output (e.g text->image, image->image) so see what parts of the API are generic across various model types and which parts are not and should live in package specifc names related to their model type.
Also some thoughts in issue https://github.com/spring-projects/spring-ai/issues/134 and https://github.com/spring-projects/spring-ai/issues/135
The PR https://github.com/spring-projects/spring-ai/pull/249 address this.