jeremychone / rust-genai

Rust multiprovider generative AI client (Ollama, OpenAi, Anthropic, Groq, Gemini, Cohere, ...)
Apache License 2.0
164 stars 35 forks source link

Make all structs serializable #19

Closed omarshehab221 closed 2 weeks ago

omarshehab221 commented 2 weeks ago

Making all structs serializable makes them usable in API Requests and IPC communication.

jeremychone commented 2 weeks ago

@omarshehab221 Very cool. Were you the one who left the comment on one of my YouTube videos?

Let me take a look at this PR.

At first glance, it looks good. However, I’m not sure I want to implement serialize/deserialize for things that aren’t exposed outside of the crate. So, I’ll probably accept/merge this PR and then make another commit to remove serialize/deserialize for anything that is internal only.

Make sense?

jeremychone commented 2 weeks ago

image

This could not compile, because reqwest::StatusCode. I will remove the serialize for this entity.

omarshehab221 commented 2 weeks ago

Yes, I was the one who made the comment. You're probably right internal things don't need to be serialized. I'm still new to rust, but I'm trying my best.

jeremychone commented 2 weeks ago

@omarshehab221 I am merging it now. Fix couple of things as extra commits. Will be in main branch soon.

jeremychone commented 2 weeks ago

@omarshehab221 Ok, this has been merged. Somehow, github did not recognize the merge, but your commit is in, plus my edits.