-
Notifications
You must be signed in to change notification settings - Fork 3
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
Initial Draft #1
Conversation
I put an example of what an API might look like in |
instructor/src/instructor.rs
Outdated
let parsed_model: StructInfo = T::get_info(); | ||
let mut error_message: Option<String> = None; | ||
|
||
for _ in 0..3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use max_retries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the things I'm struggling with in rust is that I couldn't find a way to extend the object (eg.
impl InstructorClientReq extends ChatCompletionReq{
maxRetries: u8,
...req
}
This doesn't quite seem to exist and the articles I've seen recommend simply doing something like
impl InstructorClientReq{
maxRetries: u8,
req: ChatCompletionReq
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
impl InstructorClientReq{
maxRetries: u8,
req: ChatCompletionReq
}
looks right.
make sure to also specify mode as tools since in'll be different for llama-cpp server
typos in the read me |
and we make a todo list of common types int List[Object] |
Yup I think we should just define a simple mapping of eg. u8,u16.u32, i8 -> Number and we can update this |
Depends on how we're using it. If you're using a mod from another file, you need to use the |
I've created a procedural macro that implements a get_info() method. This get_info() method will in turn generate a json obj that will take the individual types + names + comments.
Eg.
This gets transformed into
We then take this and use it to generate a function definition which can be called. Since it's a simple struct, we can just deserialize it once we get the response back from OpenAI