Interface Session

All Superinterfaces:
AutoCloseable

public interface Session extends AutoCloseable
Represents a Select AI chat session that reuses conversation context across multiple profile generation calls.

A session is created from Profile.chatSession(Conversation) or Profile.chatSession(Conversation, boolean). Each session call sends the same conversation ID to DBMS_CLOUD_AI.GENERATE so later prompts can use prior conversation context.

Closing a session does not close the SelectAI client, the Profile, or the underlying JDBC connection. If the session was created with deleteOnClose=true, closing the session drops the associated conversation.

  • Method Summary

    Modifier and Type
    Method
    Description
    chat(String prompt)
    Sends the prompt as a chat-style request using the session conversation.
    void
    Closes this session.
    Generates SQL and returns a natural-language explanation using the session conversation.
    narrate(String prompt)
    Generates and runs SQL, then asks the model to narrate the result using the session conversation.
    runsql(String prompt)
    Generates SQL from the prompt and runs it using the session conversation.
    Returns the augmented prompt that Select AI would send to the provider using the session conversation.
    showsql(String prompt)
    Generates SQL from the prompt without running it using the session conversation.