# Confusion on genai SDK design (compare to OpenAI SDK)

**URL:** <https://discuss.ai.google.dev/t/confusion-on-genai-sdk-design-compare-to-openai-sdk/81347>\
**Category:** Gemini API\
**Tags:** openai\_compatibility, generative-ai\
**Created:** [April 29, 2025, 5:01am UTC](https://discuss.ai.google.dev/t/confusion-on-genai-sdk-design-compare-to-openai-sdk/81347 "2025-04-29T05:01:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Long\_Peng](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/long_peng/32/23583_2.png) [@Long\_Peng](https://discuss.ai.google.dev/u/Long_Peng)\
**Post date:** [April 29, 2025, 5:01am UTC](https://discuss.ai.google.dev/t/confusion-on-genai-sdk-design-compare-to-openai-sdk/81347/1 "2025-04-29T05:01:20Z")

</div>

In [multi-turn-conversations](https://ai.google.dev/gemini-api/docs/text-generation#multi-turn-conversations) , you need to use `send_message` to send a message.

In [system-instructions](https://ai.google.dev/gemini-api/docs/text-generation#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

---

<div class="post-metadata">

**Author:** ![GUNAND\_MAYANGLAMBAM](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/gunand_mayanglambam/32/4964_2.png) [@GUNAND\_MAYANGLAMBAM](https://discuss.ai.google.dev/u/GUNAND_MAYANGLAMBAM)\
**Post date:** [May 22, 2025, 9:45am UTC](https://discuss.ai.google.dev/t/confusion-on-genai-sdk-design-compare-to-openai-sdk/81347/3 "2025-05-22T09:45:12Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![system](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/system/32/1_2.png) [@system](https://discuss.ai.google.dev/u/system)\
**Post date:** [November 5, 2026, 6:22pm UTC](https://discuss.ai.google.dev/t/confusion-on-genai-sdk-design-compare-to-openai-sdk/81347/5 "2026-11-05T18:22:17Z")

</div>

Closed on November 5, 2026, 6:22pm UTC

This thread was automatically closed 60 days after the last reply. If you are running into an issue, please create a new post.
