I have been experimenting with Oracle Select AI for couple of months now and it has become one of my favorite tool. The other day, I encountered an error while playing with it and it took me sometime to find a fix, so thought of sharing it with you guys.
If you don't know what Oracle Select AI is, here is a quick simple intro:
Oracle Select AI is a tool that lets you interact with your database using everyday language instead of complicated SQL code. It uses artificial intelligence (AI) to understand what you're asking and generate the right SQL queries for you. This makes it easier for everyone, regardless of their technical expertise, to get insights from their data and develop AI-based applications.
Now we know what Oracle Select AI is, lets have a look at error:
I was trying to integrate Select AI with Oracle APEX. Oracle Application Express (Oracle APEX) is a low-code application development platform that enables users to build scalable, secure enterprise applications. It is a web-based integrated development environment (IDE) that runs as part of the Oracle Database.
But when I was trying to configure profile with OpenAI's model like following:
BEGIN
DBMS_CLOUD_AI.CREATE_PROFILE(
profile_name => 'OPENAI_ORACLE',
attributes => '{ "provider": "openai",
"credential_name": "OPENAI_CRED",
"object_list": [{"owner": "SCOTT", "name": "MYTABLE"}]
}',
description => 'AI profile to use OpenAI with Oracle APEX'
);
END;
I was getting following error:
ORA-20000: ORA-24247: Network access denied by access control list (ACL)
ORA-06512: en "C##CLOUD$SERVICE.DBMS_CLOUD$PDBCS_240705_0", línea 2064
ORA-06512: en "C##CLOUD$SERVICE.DBMS_CLOUD_AI", línea 5674
ORA-06512: en línea 2 Error at Line: 7 Column: 0
After much ado, it turned out that I had missed following step to grant network access:
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
HOST => 'api.openai.com',
ACE => XS$ACE_TYPE(PRIVILEGE_LIST => XS$NAME_LIST('http'),
PRINCIPAL_NAME => 'SCOTT',
PRINCIPAL_TYPE => XS_ACL.PTYPE_DB)
);
END;
As soon as I run above network ACL command, it worked like a charm.
Hope that helps.
No comments:
Post a Comment