Skip to main content

Create Sina Session

Creates a new chat session with Sina AI.

Request

const response = await createSinaSession();

Response Example

{
"status": 201,
"data": {
"id": "chat-123",
"created_at": "2024-03-20T10:00:00Z",
"updated_at": "2024-03-20T10:00:00Z"
}
}

Error Handling

The function will throw an error if the API request fails. The error will contain the full response object as a string.

Example

try {
const chat = await createSinaSession();
} catch (error) {
console.error('Failed to create chat session:', error);
}