REST API for Chat
Using the InvokeOCIAI Method
The InvokeOCIAI method uses the existing context-based contract. Set Context to GenAI:Chat, GenAI:GenerateChatText, or GenAI:SummarizeChatText, and supply the request values through Chat_Param_n parameters.
REST API endpoint with verb as POST is as follows:
https://<hostname>:<port>/siebel/v1.0/service/SiebelOCIAIWebService/InvokeOCIAI
//Request payload with COHERE command-r
{
"body": {
"Context": "GenAI:Chat", //OR “GenAI:GenerateChatText” OR “GenAI:SummarizeChatText”
"Chat_Param_1": "prompt:Write some facts about Oracle India Pvt Ltd" ,
"Chat_Param_2": "compartmentId:ocid1.tenancy.oc1..XXXXXX",
"Chat_Param_3" : "runtimeType:COHERE",
Note: For Siebel CRM version 26.4 and above, replace “runtimeType” with “provider”.
"Chat_Param_4" : "maxTokens:3500",
"Chat_Param_5" : "temperature:0",
"Chat_Param_6" : "servingMode:ON_DEMAND",
"Chat_Param_7" : "isEcho:true",
"Chat_Param_8" : "isStream:false"
}
}
//corresponding Response Payload
{
"Status": "Success",
"Output": "CohereChatResponse(super=BaseChatResponse(super=BmcModel(__explicitlySet__=[finishReason, chatHistory, text, prompt])), text=1. Oracle India Pvt Ltd is the Indian subsidiary of the American multinational computer technology company Oracle Corporation.\n\n2. Oracle India has its headquarters in Bangalore, Karnataka. The facility spans across 9 acres and is one of the largest owned by an international software company in India.\n\n3. The Indian subsidiary was established in 1994 and has played a significant role in Oracle's global strategy.\n\n4. Oracle India Pvt Ltd is a significant research and development hub for the company, focusing on product development, support, and management. It has contributed significantly to various Oracle products and technologies.\n\n5. The company has multiple offices across India, including locations in Gurgaon, Hyderabad, Mumbai, and New Delhi, employing thousands of professionals.\n\n6. Oracle India offers a wide range of job opportunities, from software development and engineering to sales, marketing, and customer support.\n\n7. It has a strong focus on training and development, providing extensive opportunities for employees to enhance their skills and grow professionally.\n\n8. Oracle India actively engages in corporate social responsibility initiatives. It has partnered with NGOs and local communities to support education, environment sustainability, and social empowerment programs. . . . .",
"OPCRequestId": "21F32E8D687AAAAAAA/BE22BA603BB123C5E5BBBBBBB/FCCDA06F70EF3CCFCCCCCCCC"
}
Using the Chat Method
REST API endpoint with verb as POST is as
follows:
https://<hostname>:<port>/siebel/v1.0/service/SiebelOCIAIWebService/ChatThe Chat method directly invokes OCI Generative AI chat by using named request arguments such as Prompt and CompartmentId. Unlike InvokeOCIAI, this method does not use Context or Chat_Param_n parameters.
An example request is shown here:
{
"body": {
"Prompt": "Summarize the customer interaction.",
"CompartmentId": "<oci-compartment-ocid>"
}
}
The corresponding response is returned as follows:
{
"response": "<generated response>"
}
Repository Changes
Business Service: SiebelOCIAIWebService
Business Service method: Chat
Business Service Method Input arguments:
| Argument | Required | Description |
|---|---|---|
| Prompt | Required | User message or prompt. |
| CompartmentId | Required | OCI compartment OCID. |
| Provider | No | LLM provider, such as COHERE or LLAMA. Derived from the configured chat model when omitted. |
| ServingMode | No | ON_DEMAND or DEDICATED |
| MaxTokens | No | Maximum output tokens |
| Temperature | No | Sampling temperature |
| TopP | No | Top-p sampling value |
| TopK | No | Top-k sampling value |
| FrequencyPenalty | No | Frequency penalty |
| PresencePenalty | No | Presence penalty |
| IsStream | No | true or false |
| IsEcho | No | true or false |
| StopSequences / Stop | No | Comma-separated stop sequences. |
| PreambleOverride | No | Cohere preamble override. |
| CitationQuality | No | Cohere citation quality; defaults to Fast. |
| PromptTruncation | No | Cohere prompt truncation; defaults to Off. |
| ImageUrl | No | Optional local image path for supported multimodal chat flows. |
| Documents | No | JSON array or text used as chat documents or context. |
| RequestPayload | No | Full OCI JSON request body. Bypasses friendly argument mapping. |
| Path / Endpoint | No | Optional OCI endpoint or path override. Must use an HTTPS OCI host. |
| ReturnFullOutput | No | Use Y, true, or 1 to return raw output properties. |