Open nhardtskim opened 12 months ago
I guess if there is a message.function_call.arguments
, one could automatically invoke jsonlite::fromJSON()
since jsonlite is a dependency anyway, but up to you.
This looks good to me, although I'm not sure why the original code formatting is screwed up. I look forward to the merge.
Possibly add the test
if (!is.null(functions)) {
assertthat::assert_that(
is.list(functions)
)
}
@irudnyts can you merge? This would be really really great.
@irudnyts can you merge? This would be really really great.
@mpr1255 I am really sorry for the delay. I quickly reviewed several PRs. The problem is that there is a certain idea behind this package (i.e., mimic arguments from the official Python package) + certain code style. Rather than modifying someone else's code, for me, it is faster to quickly write my own.
Good news is there are plenty of new endpoints have been introduced and many functions must be depricated. So, I'll do my best to get back on the track and maintain it properly.
If you need those functionality now, you can always use remotes::install_github()
and specify @nhardtskim's commit from their fork.
I do appreciate consistency with openai's python package as an objective, and tried to be close. However, @irudnyts, be careful that, because version 1.0.0 of openai's python package had some breaking changes, and it's a bit of a headache.
Enabled OpenAI function calling, and added the example from the cookbook (https://platform.openai.com/docs/guides/gpt/function-calling).
I haven't added any parsing of the output yet, because I am not sure that is desirable or straightforward.