Skip to content

Conversation

@emil14
Copy link
Contributor

@emil14 emil14 commented Jan 4, 2025

  • Remove BaseMessage struct
  • Instead add 4 implementations of the Message interface
    • TextMessage
    • ImageMessage
    • VoiceMessage
    • EmbeddingMessage
  • Move helper functions from text_to_text and text_to_stream to helper.go and tool.go
  • Remove unused code such as NewJSONMessage
  • Remove explicit support for img-type from casting functions where we cast agency to openai message, the reason is that images were never used in that context + if we support images we need to support other kinds of messages anyway
  • Change all examples to use new API (it looks cleaner now)

…ctor: remove basemsg struct, instead add 4 implementations for each kind
Role() Role
Content() []byte
Kind() Kind
Kind() Kind // do we need this?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this anywhere except one example just to print in a specific way

I think we can get rid of this and simply cast interface to specific type

"github.com/sashabaranov/go-openai/jsonschema"
)

type ToolResultMessage struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants