Confusion on genai SDK design (compare to OpenAI SDK)

In multi-turn-conversations , you need to use send_message to send a message.

In system-instructions , you need to use generate_content to send a message. And it is strange that the system prompt is not set in the chat history.

In openai sdk, you only need chat history and completion.create(chat_history) to send the message. The chat history is easy to access.
When I see openai sdk example, I know how to send a message, how to modify the chat history, and I know how to persist the chat history(since it just something like {“role: system”,“blah blah”}).
When I see genai sdk example “multi-turn-conversations” and “system-instructions”, I don’t know how to combined “system prompt” “send message” and “manipulate chat history” these 3 functionalities together.

I didn’t use openai sdk because some functionalities are only supported in genai sdk

Hey @Long_Peng , in google-genai sdk you should be able to pass both system instructions and chat history using the chats.create function. Below is sample code:

chat = client.chats.create(
    model="gemini-2.0-flash",
    history = history_chat,
    config=types.GenerateContentConfig(
        system_instruction="You are a helpful Assistance"
    )
)