Commit graph

6 commits

Author SHA1 Message Date
Ben Browning
65c56d0ee8 chore: Address review feedback with minor code cleanups
The bulk of the change here is making the naming and contents of the
conversion to/from Responses API inputs -> Chat Completion API
messages and Chat Completion API choices -> Responses API outputs more
clear with some code comments, method renaming, and slight
refactoring.

There are also some other minor changes, like moving a pydantic model
from the api/ to the implementation since it's not actually exposed
via the API, as well as making some if/else usage more clear.

Signed-off-by: Ben Browning <bbrownin@redhat.com>
2025-05-08 07:03:47 -04:00
Derek Higgins
9166baa716 Load OpenAIChatCompletion directly from YAML
No need to iterate through the yaml when it can just be
loaded.

Signed-off-by: Derek Higgins <derekh@redhat.com>
2025-05-08 07:03:47 -04:00
Ben Browning
b90bb66f28 fix: Restore previous responses to input list, not messages
This adjusts the restoration of previous responses to prepend them to
the list of Responses API inputs instead of our converted list of Chat
Completion messages. This matches the expected behavior of the
Responses API, and I misinterpreted the nuances here in the initial implementation.

Signed-off-by: Ben Browning <bbrownin@redhat.com>
2025-05-08 07:03:47 -04:00
Derek Higgins
150b9a0834 feat(openai-responses): Support multiple message roles in API inputs
Also update the nesting to add multiple messages(where appropriate)
rather then a single message with multiple content parts.

Signed-off-by: Derek Higgins <derekh@redhat.com>
2025-05-08 06:58:43 -04:00
Derek Higgins
1369b5858e chore: Refactor OpenAIChatCompletion's to be loaded from yaml
Future tests can then re-use the content

Signed-off-by: Derek Higgins <derekh@redhat.com>
2025-05-08 06:58:42 -04:00
Derek Higgins
64829947d0
feat: Add temperature support to responses API (#2065)
# What does this PR do?
Add support for the temperature to the responses API 


## Test Plan
Manually tested simple case
unit tests added for simple case and tool calls

Signed-off-by: Derek Higgins <derekh@redhat.com>
2025-05-01 11:47:58 -07:00