001/*
002 * Copyright (c) 2026, Oracle and/or its affiliates.
003 *
004 * Licensed under the Universal Permissive License Version 1.0 as shown at
005 * https://oss.oracle.com/licenses/upl/
006 */
007package com.oracle.database.selectai;
008
009import com.oracle.database.selectai.model.GenerateAction;
010import com.oracle.database.selectai.model.Feedback;
011import com.oracle.database.selectai.model.GenerateParams;
012import com.oracle.database.selectai.model.ProfileAttributes;
013import com.oracle.database.selectai.model.SelectAIException;
014import com.oracle.database.selectai.model.SummaryParams;
015import com.oracle.database.selectai.model.SyntheticDataBatchRequest;
016import com.oracle.database.selectai.model.SyntheticDataSingleRequest;
017
018/**
019 * Contract for Select AI profile lifecycle, prompt execution, and attribute
020 * management.
021 * <p>
022 * An AI profile is the database-side configuration that tells Select AI which
023 * provider and AI model to use, which credential authorizes provider calls, and which
024 * schema metadata or vector index should be used when answering natural
025 * language prompts. A {@code Profile} instance may represent a profile created
026 * by this Java SDK, PL/SQL, Python, SQL tools, or any other client, as long as
027 * that profile is visible in the current schema.
028 * <p>
029 * A {@code Profile} object can be configured for creation or database-backed.
030 * A configured profile has a profile name, attributes, description, and status
031 * in memory, but it is not persisted until {@link #create()} succeeds. A
032 * database-backed profile is opened from the database, listed from metadata, or
033 * successfully created through this SDK.
034 * <p>
035 * Profile attributes supplied through creation or update builders are validated
036 * against values known by this SDK release. Attributes hydrated from an
037 * existing database profile are treated as database metadata: known values keep
038 * the existing normalization behavior, while values introduced by a newer
039 * database release are preserved instead of causing profile loading or listing
040 * to fail.
041 * <p>
042 * Metadata getters can return configured values before creation. Operations
043 * that execute against an existing database profile, such as prompt
044 * generation, attribute updates, enable, disable, drop, feedback, summarize,
045 * translate, and synthetic-data generation, require a database-backed profile.
046 * The SDK rejects those operations with {@link IllegalStateException} when the
047 * object is not bound to a profile name or is configured for creation but has
048 * not been created yet.
049 *
050 * @see <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/select-ai-manage-profiles.html">
051 *      Manage AI profiles</a>
052 * @see <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/select-ai-about.html">
053 *      About Select AI</a>
054 */
055public interface Profile {
056    /**
057     * Creates this configured profile in the database.
058     * <p>
059     * For a complete runnable sample source, see
060     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/CreateProfileSample.html">
061     * CreateProfileSample source</a>.
062     *
063     * @return {@code true} when create succeeds
064     * @throws IllegalStateException when this Profile instance is not configured for creation
065     * @throws SelectAIException when create fails
066     */
067    boolean create() throws SelectAIException;
068
069    /**
070     * Drops this profile from the database.
071     * <p>
072     * Use this when the provider and AI model configuration is no longer needed. The
073     * operation affects the database profile object, not only the Java object.
074     * For a complete runnable sample source, see
075     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/DropProfileSample.html">
076     * DropProfileSample source</a>.
077     *
078     * @param force when {@code true}, force drop is attempted
079     * @return {@code true} when drop succeeds
080     * @throws IllegalStateException when this Profile instance is not bound to a profile name
081     *         or is configured for creation but has not been created yet
082     * @throws SelectAIException when drop fails
083     */
084    boolean drop(boolean force) throws SelectAIException;
085
086    /**
087     * Enables this profile so it can be used for Select AI operations.
088     * <p>
089     * For a complete runnable sample source, see
090     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/EnableProfileSample.html">
091     * EnableProfileSample source</a>.
092     *
093     * @return {@code true} when enable succeeds
094     * @throws IllegalStateException when this Profile instance is not bound to a profile name
095     *         or is configured for creation but has not been created yet
096     * @throws SelectAIException when enable fails
097     */
098    boolean enable() throws SelectAIException;
099
100    /**
101     * Disables this profile so callers cannot use it for Select AI operations
102     * until it is enabled again.
103     * <p>
104     * For a complete runnable sample source, see
105     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/DisableProfileSample.html">
106     * DisableProfileSample source</a>.
107     *
108     * @return {@code true} when disable succeeds
109     * @throws IllegalStateException when this Profile instance is not bound to a profile name
110     *         or is configured for creation but has not been created yet
111     * @throws SelectAIException when disable fails
112     */
113    boolean disable() throws SelectAIException;
114
115    /**
116     * Sends a natural-language prompt to Select AI using this profile.
117     * <p>
118     * The selected action determines whether Select AI runs SQL, returns SQL,
119     * explains SQL, narrates query results, chats, generates embeddings, or
120     * shows the provider-facing prompt.
121     * For a complete runnable sample source, see
122     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GenerateProfileSample.html">
123     * GenerateProfileSample source</a>.
124     *
125     * @param prompt natural language prompt
126     * @param generateAction action type (runsql, showsql, chat, embedding, etc.)
127     * @return generated response text
128     * @throws IllegalArgumentException when {@code prompt} is null/blank or
129     *         {@code generateAction} is null
130     * @throws IllegalStateException when this Profile instance is not bound to a profile name
131     *         or is configured for creation but has not been created yet
132     * @throws SelectAIException when generation fails
133     */
134    String generate(String prompt, GenerateAction generateAction) throws SelectAIException;
135
136    /**
137     * Sends a natural-language prompt to Select AI using this profile and
138     * request-level profile attributes.
139     * <p>
140     * The supplied {@code profileAttributes} are passed only for this generate
141     * request. They do not update the stored profile definition.
142     * For a complete runnable sample source, see
143     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GenerateWithProfileAttributesSample.html">
144     * GenerateWithProfileAttributesSample source</a>.
145     *
146     * @param prompt natural language prompt
147     * @param generateAction action type (runsql, showsql, chat, embedding, etc.)
148     * @param profileAttributes optional request-level profile attributes
149     * @return generated response text
150     * @throws IllegalArgumentException when {@code prompt} is null/blank or
151     *         {@code generateAction} is null
152     * @throws IllegalStateException when this Profile instance is not bound to a profile name
153     *         or is configured for creation but has not been created yet
154     * @throws SelectAIException when generation fails
155     */
156    String generate(String prompt, GenerateAction generateAction, ProfileAttributes profileAttributes) throws SelectAIException;
157
158    /**
159     * Sends a natural-language prompt to Select AI using this profile and
160     * optional generate parameters.
161     * <p>
162     * Generate parameters are serialized to the {@code params} payload accepted
163     * by {@code DBMS_CLOUD_AI.GENERATE}. For example, callers can pass a
164     * conversation identifier for context-aware chat requests.
165     * For a complete runnable sample source, see
166     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GenerateWithGenerateParamsSample.html">
167     * GenerateWithGenerateParamsSample source</a>.
168     *
169     * @param prompt natural language prompt
170     * @param generateAction action type (runsql, showsql, chat, embedding, etc.)
171     * @param generateParams optional generate parameters
172     * @return generated response text
173     * @throws IllegalArgumentException when {@code prompt} is null/blank or
174     *         {@code generateAction} is null
175     * @throws IllegalStateException when this Profile instance is not bound to a profile name
176     *         or is configured for creation but has not been created yet
177     * @throws SelectAIException when generation fails
178     */
179    String generate(String prompt, GenerateAction generateAction, GenerateParams generateParams) throws SelectAIException;
180
181    /**
182     * Sends a natural-language prompt to Select AI using this profile,
183     * request-level profile attributes, and optional generate parameters.
184     * <p>
185     * The supplied {@code profileAttributes} are passed only for this generate
186     * request and do not update the stored profile definition.
187     * {@code generateParams} are serialized to the {@code params} payload
188     * accepted by {@code DBMS_CLOUD_AI.GENERATE}.
189     * For a complete runnable sample source, see
190     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GenerateWithProfileAttributesAndGenerateParamsSample.html">
191     * GenerateWithProfileAttributesAndGenerateParamsSample source</a>.
192     *
193     * @param prompt natural language prompt
194     * @param generateAction action type (runsql, showsql, chat, embedding, etc.)
195     * @param profileAttributes optional request-level profile attributes
196     * @param generateParams optional generate parameters
197     * @return generated response text
198     * @throws IllegalArgumentException when {@code prompt} is null/blank or
199     *         {@code generateAction} is null
200     * @throws IllegalStateException when this Profile instance is not bound to a profile name
201     *         or is configured for creation but has not been created yet
202     * @throws SelectAIException when generation fails
203     */
204    String generate(String prompt, GenerateAction generateAction, ProfileAttributes profileAttributes,
205                    GenerateParams generateParams) throws SelectAIException;
206
207    /**
208     * Generates SQL from the prompt and runs it.
209     * <p>
210     * Use this for NL2SQL workflows where the application wants the database
211     * result rather than only the generated SQL text.
212     * For a complete runnable sample source, see
213     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/RunSqlProfileSample.html">
214     * RunSqlProfileSample source</a>.
215     *
216     * @param prompt natural language prompt
217     * @return generated SQL execution result/content
218     * @throws IllegalArgumentException when {@code prompt} is null or blank
219     * @throws IllegalStateException when this Profile instance is not bound to a profile name
220     *         or is configured for creation but has not been created yet
221     * @throws SelectAIException when generation fails
222     * @see #generate(String, GenerateAction)
223     */
224    String runsql(String prompt) throws SelectAIException;
225
226    /**
227     * Generates SQL from the prompt and runs it using optional generate
228     * parameters.
229     * <p>
230     * For a complete runnable sample source, see
231     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/RunSqlWithGenerateParamsSample.html">
232     * RunSqlWithGenerateParamsSample source</a>.
233     *
234     * @param prompt natural language prompt
235     * @param generateParams optional generate parameters, such as conversation ID
236     * @return generated SQL execution result/content
237     * @throws IllegalArgumentException when {@code prompt} is null or blank
238     * @throws IllegalStateException when this Profile instance is not bound to a profile name
239     *         or is configured for creation but has not been created yet
240     * @throws SelectAIException when generation fails
241     * @see #generate(String, GenerateAction, GenerateParams)
242     */
243    String runsql(String prompt, GenerateParams generateParams) throws SelectAIException;
244
245    /**
246     * Generates SQL from the prompt without running it.
247     * <p>
248     * Use this when the application wants to review, log, or approve SQL before
249     * execution.
250     * For a complete runnable sample source, see
251     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ShowSqlProfileSample.html">
252     * ShowSqlProfileSample source</a>.
253     *
254     * @param prompt natural language prompt
255     * @return generated SQL text
256     * @throws IllegalArgumentException when {@code prompt} is null or blank
257     * @throws IllegalStateException when this Profile instance is not bound to a profile name
258     *         or is configured for creation but has not been created yet
259     * @throws SelectAIException when generation fails
260     * @see #generate(String, GenerateAction)
261     */
262    String showsql(String prompt) throws SelectAIException;
263
264    /**
265     * Generates SQL from the prompt without running it using optional generate
266     * parameters.
267     * <p>
268     * For a complete runnable sample source, see
269     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ShowSqlWithGenerateParamsSample.html">
270     * ShowSqlWithGenerateParamsSample source</a>.
271     *
272     * @param prompt natural language prompt
273     * @param generateParams optional generate parameters, such as conversation ID
274     * @return generated SQL text
275     * @throws IllegalArgumentException when {@code prompt} is null or blank
276     * @throws IllegalStateException when this Profile instance is not bound to a profile name
277     *         or is configured for creation but has not been created yet
278     * @throws SelectAIException when generation fails
279     * @see #generate(String, GenerateAction, GenerateParams)
280     */
281    String showsql(String prompt, GenerateParams generateParams) throws SelectAIException;
282
283    /**
284     * Generates SQL and returns a natural-language explanation.
285     * <p>
286     * For a complete runnable sample source, see
287     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ExplainSqlProfileSample.html">
288     * ExplainSqlProfileSample source</a>.
289     *
290     * @param prompt natural language prompt
291     * @return explanation of generated SQL
292     * @throws IllegalArgumentException when {@code prompt} is null or blank
293     * @throws IllegalStateException when this Profile instance is not bound to a profile name
294     *         or is configured for creation but has not been created yet
295     * @throws SelectAIException when generation fails
296     * @see #generate(String, GenerateAction)
297     */
298    String explainsql(String prompt) throws SelectAIException;
299
300    /**
301     * Generates SQL and returns a natural-language explanation using optional
302     * generate parameters.
303     * <p>
304     * For a complete runnable sample source, see
305     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ExplainSqlWithGenerateParamsSample.html">
306     * ExplainSqlWithGenerateParamsSample source</a>.
307     *
308     * @param prompt natural language prompt
309     * @param generateParams optional generate parameters, such as conversation ID
310     * @return explanation of generated SQL
311     * @throws IllegalArgumentException when {@code prompt} is null or blank
312     * @throws IllegalStateException when this Profile instance is not bound to a profile name
313     *         or is configured for creation but has not been created yet
314     * @throws SelectAIException when generation fails
315     * @see #generate(String, GenerateAction, GenerateParams)
316     */
317    String explainsql(String prompt, GenerateParams generateParams) throws SelectAIException;
318
319    /**
320     * Generates and runs SQL, then asks the model to narrate the result.
321     * <p>
322     * This action can require data access because the model may receive query
323     * result values to produce the narrative response.
324     * For a complete runnable sample source, see
325     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/NarrateProfileSample.html">
326     * NarrateProfileSample source</a>.
327     *
328     * @param prompt natural language prompt
329     * @return narrative response
330     * @throws IllegalArgumentException when {@code prompt} is null or blank
331     * @throws IllegalStateException when this Profile instance is not bound to a profile name
332     *         or is configured for creation but has not been created yet
333     * @throws SelectAIException when generation fails
334     * @see #generate(String, GenerateAction)
335     */
336    String narrate(String prompt) throws SelectAIException;
337
338    /**
339     * Generates and runs SQL, then asks the model to narrate the result using
340     * optional generate parameters.
341     * <p>
342     * For a complete runnable sample source, see
343     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/NarrateWithGenerateParamsSample.html">
344     * NarrateWithGenerateParamsSample source</a>.
345     *
346     * @param prompt natural language prompt
347     * @param generateParams optional generate parameters, such as conversation ID
348     * @return narrative response
349     * @throws IllegalArgumentException when {@code prompt} is null or blank
350     * @throws IllegalStateException when this Profile instance is not bound to a profile name
351     *         or is configured for creation but has not been created yet
352     * @throws SelectAIException when generation fails
353     * @see #generate(String, GenerateAction, GenerateParams)
354     */
355    String narrate(String prompt, GenerateParams generateParams) throws SelectAIException;
356
357    /**
358     * Returns the augmented prompt that Select AI would send to the provider.
359     * <p>
360     * Use this for troubleshooting profile metadata, object selection, and
361     * prompt augmentation behavior.
362     * For a complete runnable sample source, see
363     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ShowPromptProfileSample.html">
364     * ShowPromptProfileSample source</a>.
365     *
366     * @param prompt natural language prompt
367     * @return rewritten/provider-facing prompt
368     * @throws IllegalArgumentException when {@code prompt} is null or blank
369     * @throws IllegalStateException when this Profile instance is not bound to a profile name
370     *         or is configured for creation but has not been created yet
371     * @throws SelectAIException when generation fails
372     * @see #generate(String, GenerateAction)
373     */
374    String showprompt(String prompt) throws SelectAIException;
375
376    /**
377     * Returns the augmented prompt that Select AI would send to the provider
378     * using optional generate parameters.
379     * <p>
380     * For a complete runnable sample source, see
381     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ShowPromptWithGenerateParamsSample.html">
382     * ShowPromptWithGenerateParamsSample source</a>.
383     *
384     * @param prompt natural language prompt
385     * @param generateParams optional generate parameters, such as conversation ID
386     * @return rewritten/provider-facing prompt
387     * @throws IllegalArgumentException when {@code prompt} is null or blank
388     * @throws IllegalStateException when this Profile instance is not bound to a profile name
389     *         or is configured for creation but has not been created yet
390     * @throws SelectAIException when generation fails
391     * @see #generate(String, GenerateAction, GenerateParams)
392     */
393    String showprompt(String prompt, GenerateParams generateParams) throws SelectAIException;
394
395    /**
396     * Sends the prompt as a chat-style request using this profile.
397     * <p>
398     * For a complete runnable sample source, see
399     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ChatProfileSample.html">
400     * ChatProfileSample source</a>.
401     *
402     * @param prompt natural language prompt
403     * @return chat response
404     * @throws IllegalArgumentException when {@code prompt} is null or blank
405     * @throws IllegalStateException when this Profile instance is not bound to a profile name
406     *         or is configured for creation but has not been created yet
407     * @throws SelectAIException when generation fails
408     * @see #generate(String, GenerateAction)
409     */
410    String chat(String prompt) throws SelectAIException;
411
412    /**
413     * Sends the prompt as a chat-style request using optional generate
414     * parameters.
415     * <p>
416     * For a complete runnable sample source, see
417     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ChatWithGenerateParamsSample.html">
418     * ChatWithGenerateParamsSample source</a>.
419     *
420     * @param prompt natural language prompt
421     * @param generateParams optional generate parameters, such as conversation ID
422     * @return chat response
423     * @throws IllegalArgumentException when {@code prompt} is null or blank
424     * @throws IllegalStateException when this Profile instance is not bound to a profile name
425     *         or is configured for creation but has not been created yet
426     * @throws SelectAIException when generation fails
427     * @see #generate(String, GenerateAction, GenerateParams)
428     */
429    String chat(String prompt, GenerateParams generateParams) throws SelectAIException;
430
431    /**
432     * Starts a Select AI chat session using the supplied conversation.
433     * <p>
434     * If the conversation does not yet have a conversation ID, this method
435     * calls {@link Conversation#create()} before creating the session. The
436     * resulting conversation ID is sent with each session generation request.
437     * For a complete runnable sample source, see
438     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ChatSessionWithoutDeleteSample.html">
439     * ChatSessionWithoutDeleteSample source</a>.
440     *
441     * @param conversation conversation to use for context-aware generation
442     * @return session bound to the conversation ID
443     * @throws IllegalArgumentException when {@code conversation} is null
444     * @throws IllegalStateException when this Profile instance is not bound to a profile name
445     *         or is configured for creation but has not been created yet
446     * @throws SelectAIException when conversation creation or session initialization fails
447     */
448    Session chatSession(Conversation conversation) throws SelectAIException;
449
450    /**
451     * Starts a Select AI chat session using the supplied conversation.
452     * <p>
453     * When {@code deleteOnClose} is true, {@link Session#close()} drops the
454     * conversation. Closing the session does not close this profile, the
455     * {@link SelectAI} client, or the underlying JDBC connection.
456     * For a complete runnable sample source, see
457     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/ChatSessionProfileSample.html">
458     * ChatSessionProfileSample source</a>.
459     *
460     * @param conversation conversation to use for context-aware generation
461     * @param deleteOnClose whether to drop the conversation when the session closes
462     * @return session bound to the conversation ID
463     * @throws IllegalArgumentException when {@code conversation} is null
464     * @throws IllegalStateException when this Profile instance is not bound to a profile name
465     *         or is configured for creation but has not been created yet
466     * @throws SelectAIException when conversation creation, drop, or session initialization fails
467     */
468    Session chatSession(Conversation conversation, boolean deleteOnClose) throws SelectAIException;
469
470    /**
471     * Updates one profile attribute using a string value.
472     * <p>
473     * Profile attributes tune provider settings, object selection, AI model
474     * behavior, RAG configuration, and other Select AI behavior.
475     * For a complete runnable sample source, see
476     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SetProfileStringAttributeSample.html">
477     * SetProfileStringAttributeSample source</a>.
478     *
479     * @param attributeName attribute name
480     * @param attributeValue attribute value (null clears attribute where supported)
481     * @return {@code true} when update succeeds
482     * @throws IllegalStateException when this Profile instance is not bound to a profile name
483     *         or is configured for creation but has not been created yet
484     * @throws SelectAIException when update fails
485     */
486    boolean setAttribute(String attributeName, String attributeValue) throws SelectAIException;
487
488    /**
489     * Updates one profile attribute using a boolean value.
490     * <p>
491     * For a complete runnable sample source, see
492     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SetProfileBooleanAttributeSample.html">
493     * SetProfileBooleanAttributeSample source</a>.
494     *
495     * @param attributeName attribute name
496     * @param attributeValue boolean value
497     * @return {@code true} when update succeeds
498     * @throws IllegalStateException when this Profile instance is not bound to a profile name
499     *         or is configured for creation but has not been created yet
500     * @throws SelectAIException when update fails
501     */
502    boolean setAttribute(String attributeName, boolean attributeValue) throws SelectAIException;
503
504    /**
505     * Updates one profile attribute using an integer value.
506     * <p>
507     * For a complete runnable sample source, see
508     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SetProfileIntegerAttributeSample.html">
509     * SetProfileIntegerAttributeSample source</a>.
510     *
511     * @param attributeName attribute name
512     * @param attributeValue integer value
513     * @return {@code true} when update succeeds
514     * @throws IllegalStateException when this Profile instance is not bound to a profile name
515     *         or is configured for creation but has not been created yet
516     * @throws SelectAIException when update fails
517     */
518    boolean setAttribute(String attributeName, Integer attributeValue) throws SelectAIException;
519
520    /**
521     * Updates one profile attribute using a floating-point value.
522     * <p>
523     * For a complete runnable sample source, see
524     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SetProfileFloatAttributeSample.html">
525     * SetProfileFloatAttributeSample source</a>.
526     *
527     * @param attributeName attribute name
528     * @param attributeValue float value
529     * @return {@code true} when update succeeds
530     * @throws IllegalStateException when this Profile instance is not bound to a profile name
531     *         or is configured for creation but has not been created yet
532     * @throws SelectAIException when update fails
533     */
534    boolean setAttribute(String attributeName, Float attributeValue) throws SelectAIException;
535
536    /**
537     * Replaces or updates multiple profile attributes in one operation.
538     * <p>
539     * Attributes built for creation or update are validated by the SDK where a
540     * current-value constraint is known. Attributes returned by
541     * {@link #getProfileAttributes()} can be reused to preserve database-defined
542     * values introduced by a newer database release; final semantic validation
543     * is performed by {@code DBMS_CLOUD_AI}.
544     * <p>
545     * For a complete runnable sample source, see
546     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SetProfileAttributesSample.html">
547     * SetProfileAttributesSample source</a>.
548     *
549     * @param profileAttributes attributes payload
550     * @return {@code true} when update succeeds
551     * @throws IllegalStateException when this Profile instance is not bound to a profile name
552     *         or is configured for creation but has not been created yet
553     * @throws SelectAIException when update fails
554     */
555    boolean setAttributes(ProfileAttributes profileAttributes) throws SelectAIException;
556
557    /**
558     * Stores or removes feedback about generated SQL for this profile.
559     * <p>
560     * Feedback is profile-specific guidance for NL2SQL behavior, not a general
561     * rating for chat or RAG answers. Positive feedback confirms that generated
562     * SQL is useful; negative feedback can include the expected response and
563     * explanatory comments so future prompts can be guided toward a better SQL
564     * shape. The target profile is this {@code Profile} instance.
565     * For a complete runnable sample source, see
566     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SubmitFeedbackProfileSample.html">
567     * SubmitFeedbackProfileSample source</a>.
568     *
569     * @param feedbackRequest feedback payload
570     * @return {@code true} when feedback is successfully submitted
571     * @throws IllegalStateException when this Profile instance is not bound to a profile name
572     *         or is configured for creation but has not been created yet
573     * @throws SelectAIException when submission fails
574     * @see <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-ai-package.html">
575     *      DBMS_CLOUD_AI feedback reference</a>
576     */
577    boolean feedback(Feedback feedbackRequest) throws SelectAIException;
578
579    /**
580     * Generates synthetic data using this profile and a single-object request payload.
581     * <p>
582     * The target AI profile is this {@code Profile} instance. The request object
583     * keeps the object name, owner, row count, prompt guidance, and optional
584     * generation parameters together.
585     * For a complete runnable sample source, see
586     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GenerateSyntheticDataSingleRequestSample.html">
587     * GenerateSyntheticDataSingleRequestSample source</a>.
588     *
589     * @param request single request payload
590     * @return {@code true} when generation request is accepted/succeeds
591     * @throws IllegalStateException when this Profile instance is not bound to a profile name
592     *         or is configured for creation but has not been created yet
593     * @throws SelectAIException when single-request synthetic data generation fails
594     * @see <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-ai-package.html">
595     *      DBMS_CLOUD_AI synthetic data reference</a>
596     */
597    boolean generateSyntheticData(SyntheticDataSingleRequest request) throws SelectAIException;
598
599    /**
600     * Generates synthetic data using this profile for multiple objects in one request.
601     * <p>
602     * Batch generation is useful for related tables where referential or
603     * domain consistency across generated data matters. The target AI profile is
604     * this {@code Profile} instance.
605     * For a complete runnable sample source, see
606     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GenerateSyntheticDataBatchRequestSample.html">
607     * GenerateSyntheticDataBatchRequestSample source</a>.
608     *
609     * @param request batch request payload
610     * @return {@code true} when generation request is accepted/succeeds
611     * @throws IllegalStateException when this Profile instance is not bound to a profile name
612     *         or is configured for creation but has not been created yet
613     * @throws SelectAIException when batch synthetic data generation fails
614     * @see <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-ai-package.html">
615     *      DBMS_CLOUD_AI synthetic data reference</a>
616     */
617    boolean generateSyntheticData(SyntheticDataBatchRequest request) throws SelectAIException;
618
619    /**
620     * Summarizes inline text or content read from an external location.
621     * <p>
622     * Use this operation when the application wants a concise natural-language
623     * summary rather than generated SQL. The request may provide text directly
624     * or reference content through a location and credential.
625     * For a complete runnable sample source, see
626     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/SummarizeProfileSample.html">
627     * SummarizeProfileSample source</a>.
628     *
629     * @param content inline content
630     * @param credential_name credential name for external source access
631     * @param location_uri source URI
632     * @param userPrompt summarization prompt/instructions
633     * @param params typed summarization parameters
634     * @return summary text
635     * @throws IllegalArgumentException when neither or both of {@code content} and {@code location_uri} are provided
636     * @throws IllegalStateException when this Profile instance is not bound to a profile name
637     *         or is configured for creation but has not been created yet
638     * @throws SelectAIException when the database summarization call fails
639     * @see <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-ai-package.html">
640             DBMS_CLOUD_AI summarization reference</a>
641     */
642    String summarize(String content,
643                     String credential_name,
644                     String location_uri,
645                     String userPrompt,
646                     SummaryParams params) throws SelectAIException;
647
648    /**
649     * Translates text using the provider configured by this profile.
650     * <p>
651     * Source and target languages are omitted. The database can use profile
652     * language attributes or source-language detection according to
653     * {@code DBMS_CLOUD_AI.TRANSLATE} behavior.
654     * For a complete runnable sample source, see
655     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/TranslateProfileSample.html">
656     * TranslateProfileSample source</a>.
657     *
658     * @param text source text
659     * @return translated text
660     * @throws IllegalArgumentException when {@code text} is null or blank
661     * @throws IllegalStateException when this Profile instance is not bound to a profile name
662     *         or is configured for creation but has not been created yet
663     * @throws SelectAIException when translation fails
664     */
665    String translate(String text) throws SelectAIException;
666
667    /**
668     * Translates text using the provider configured by this profile and an
669     * explicit target language.
670     * <p>
671     * The source language is omitted. The database can use profile language
672     * attributes or source-language detection according to
673     * {@code DBMS_CLOUD_AI.TRANSLATE} behavior.
674     * For a complete runnable sample source, see
675     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/TranslateProfileSample.html">
676     * TranslateProfileSample source</a>.
677     *
678     * @param text source text
679     * @param targetLanguage target language/code
680     * @return translated text
681     * @throws IllegalArgumentException when {@code text} is null or blank
682     * @throws IllegalStateException when this Profile instance is not bound to a profile name
683     *         or is configured for creation but has not been created yet
684     * @throws SelectAIException when translation fails
685     */
686    String translate(String text,
687                     String targetLanguage) throws SelectAIException;
688
689    /**
690     * Translates text using the provider configured by this profile.
691     * <p>
692     * Source and target language values are optional and may be {@code null}.
693     * When omitted, the database can use profile language attributes or
694     * source-language detection according to {@code DBMS_CLOUD_AI.TRANSLATE}
695     * behavior.
696     * For a complete runnable sample source, see
697     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/TranslateProfileSample.html">
698     * TranslateProfileSample source</a>.
699     *
700     * @param text source text
701     * @param sourceLanguage source language/code
702     * @param targetLanguage target language/code
703     * @return translated text
704     * @throws IllegalArgumentException when {@code text} is null or blank
705     * @throws IllegalStateException when this Profile instance is not bound to a profile name
706     *         or is configured for creation but has not been created yet
707     * @throws SelectAIException when translation fails
708     */
709    String translate(String text,
710                     String sourceLanguage,
711                     String targetLanguage) throws SelectAIException;
712
713    /**
714     * Returns profile name.
715     * <p>
716     * For a complete runnable sample source, see
717     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GetProfileNameSample.html">
718     * GetProfileNameSample source</a>.
719     *
720     * @return profile name
721     */
722    String getProfileName();
723
724    /**
725     * Returns profile status.
726     * <p>
727     * For a configured profile that has not been created yet, returns the
728     * caller-supplied create status. For a profile bound to an existing
729     * database profile, refreshes metadata from the database before returning
730     * the status.
731     * For a complete runnable sample source, see
732     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GetProfileStatusSample.html">
733     * GetProfileStatusSample source</a>.
734     *
735     * @return profile status
736     * @throws SelectAIException when current profile metadata cannot be fetched
737     */
738    String getStatus() throws SelectAIException;
739
740    /**
741     * Returns profile description.
742     * <p>
743     * For a complete runnable sample source, see
744     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GetProfileDescriptionSample.html">
745     * GetProfileDescriptionSample source</a>.
746     *
747     * @return profile description
748     */
749    String getDescription();
750
751    /**
752     * Returns profile attributes.
753     * <p>
754     * For a configured profile that has not been created yet, returns the
755     * caller-supplied create attributes. For a profile bound to an existing
756     * database profile, refreshes attributes from the database before returning
757     * them. Database-defined values for provider, OCI API format, and
758     * object-list mode are preserved even when they are not recognized by this
759     * SDK release.
760     * For a complete runnable sample source, see
761     * <a href="{@docRoot}/src-html/com/oracle/database/selectai/samples/profile/GetProfileAttributesSample.html">
762     * GetProfileAttributesSample source</a>.
763     *
764     * @return profile attributes
765     * @throws IllegalStateException when this Profile instance is not bound to a profile name
766     * @throws SelectAIException when current profile attributes cannot be fetched
767     */
768    ProfileAttributes getProfileAttributes() throws SelectAIException;
769}