Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter for image description; Refactor library core #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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
type Message interface {
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.

1 participant