cURL code to include System Instructions

It seems to me the when “Get Code” - only Python code option includes the text of the System Instructions.

I’d really be glad to use System Instructions in my simple API call (using cURL or similar POST HTTP call) and can’t find the correct format for it.

It would be really appreciated if the way the Python library is parsing and passing the System Instructions part in the calling object will be enclosed.

With appreciations to your great work!

Thank you for this post, @Offer!
Updating “Get Code” w/ system instructions is on our plate. In the meantime, you can find examples on how to use system instructions with cURL in the Cookbook: cookbook/quickstarts/rest/System_instructions_REST.ipynb at main · google-gemini/cookbook · GitHub

1 Like

Thank you so much for this!

This’s exactly what I was looking for.

Again - Thanks for your great work for the benefit of all of us!

1 Like

It only works in v1beta. Is system instruction not available in v1?

I keep getting the message following

“message”: “Invalid JSON payload received. Unknown name "system_instruction": Cannot find field.”,

3 Likes

system_instruction Cannot find field
v1 fail same here
at this project GitHub - xlinx/sd-webui-decadetw-auto-prompt-llm: sd-webui-auto-prompt-llm