Skip to content

Initial support for the Responses API - #42

Merged
phartenfeller merged 11 commits into
developmentfrom
responses_api
Jan 21, 2026
Merged

Initial support for the Responses API#42
phartenfeller merged 11 commits into
developmentfrom
responses_api

Conversation

@phartenfeller

Copy link
Copy Markdown
Member

Closes #40

Currently just for OpenAI and opt-in. See the test package form more examples.

   uc_ai_openai.g_use_responses_api := true;

    l_result := uc_ai.GENERATE_TEXT(
      p_system_prompt => 'You are a helpful assistant.',
      p_user_prompt => 'Remember this number: 42. Say "I will remember 42".',
      p_provider => uc_ai.c_provider_openai,
      p_model => uc_ai_openai.c_model_gpt_4o_mini
    );

@phartenfeller
phartenfeller merged commit ac39e88 into development Jan 21, 2026
3 checks passed
@phartenfeller
phartenfeller deleted the responses_api branch January 21, 2026 15:02
, p_schema => p_schema
);
else
return generate_text_chat_api(

Check warning

Code scanning / dbLinter

Always make the RETURN statement the last statement of your function. Warning

RETURN is not the last statement in generate_text.

-- Convert input object to JSON string for arguments
declare
l_input_obj json_object_t := l_content_item.get_object('input');

Check notice

Code scanning / dbLinter

Avoid initializing variables using functions in the declaration section.

Function call in declare section.
-- Extract providerOptions if present
if l_content_item.has('providerOptions') and not l_content_item.get('providerOptions').is_null then
declare
l_provider_options json_object_t := l_content_item.get_object('providerOptions');

Check notice

Code scanning / dbLinter

Avoid initializing variables using functions in the declaration section.

Function call in declare section.
-- Output can be string or structured content
if l_content_item.has('content') then
declare
l_result_content json_element_t := l_content_item.get('content');

Check notice

Code scanning / dbLinter

Avoid initializing variables using functions in the declaration section.

Function call in declare section.
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.

Response API

2 participants