Skip to main content

Generate (Sync)

This API lets you ask questions to the LLMs in a synchronous way. This API corresponds to the completion API.

Use the OptionBuilder to build the Options object with extra parameters. Refer to this.

Try asking a question about the model

Loading code...

You will get a response similar to:

LLM Response

I am a large language model created by Alibaba Cloud. My purpose is to assist users in generating text, answering questions, and completing tasks. I aim to be user-friendly and easy to understand for everyone who interacts with me.

Try asking a question, receiving the answer streamed

Loading code...

You will get a response similar to:

LLM Response

The

The capital

The capital of

The capital of France

The capital of France is

The capital of France is Paris

The capital of France is Paris.

Generate structured output

With response as a Map

Loading code...

You will get a response similar to:

LLM Response
{
"available": true,
"age": 22
}

With response mapped to specified class type

Loading code...
LLM Response

Person(age=28, available=false)