Getting Started with the Gemini API in Agent Platform with cURL Reviews

65432 reviews

Madhur T. · Reviewed over 2 years ago

Sanjukta D. · Reviewed over 2 years ago

Aditya Kumar S. · Reviewed over 2 years ago

Neelu T. · Reviewed over 2 years ago

Very much.

Sumit S. · Reviewed over 2 years ago

Ayush K. · Reviewed over 2 years ago

Sanchit K. · Reviewed over 2 years ago

Sachinkumar N. · Reviewed over 2 years ago

Rhythm G. · Reviewed over 2 years ago

Sampath J. · Reviewed over 2 years ago

ABHIJEET B. · Reviewed over 2 years ago

Nakul N. · Reviewed over 2 years ago

Vaishnavi H. · Reviewed over 2 years ago

Jasmine G. · Reviewed over 2 years ago

Gargi C. · Reviewed over 2 years ago

Viraj S. · Reviewed over 2 years ago

Aleena M. · Reviewed over 2 years ago

Amartya G. · Reviewed over 2 years ago

Krushnali G. · Reviewed over 2 years ago

good lab

Abhijeet C. · Reviewed over 2 years ago

Shreya P. · Reviewed over 2 years ago

hiba h. · Reviewed over 2 years ago

Great

Anubhav s. · Reviewed over 2 years ago

Gopika C. · Reviewed over 2 years ago

Up against this firewall. Cannot proceed further. CANNOT SOLVE THIS. Will TRY Again. Ran this code in the exercise (3rd in line): %%bash MODEL_ID="gemini-1.0-pro" curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:streamGenerateContent \ -d '{ "contents": { "role": "USER", "parts": { "text": "Why is the sky blue?" } } }' Came up with the error: curl: (3) bad range in URL position 60: https://us-central1-aiplatform.googleapis.com/v1/projects/[qwiklabs-gcp-04-634a559125a9]/locations/us-central1/publishers/google/models/gemini-1.0-pro:streamGenerateContent ^ --------------------------------------------------------------------------- CalledProcessError Traceback (most recent call last) Cell In[26], line 1 ----> 1 get_ipython().run_cell_magic('bash', '', '\nMODEL_ID="gemini-1.0-pro"\n\ncurl -X POST \\\n -H "Authorization: Bearer $(gcloud auth print-access-token)" \\\n -H "Content-Type: application/json" \\\n https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:streamGenerateContent \\\n -d \'{\n "contents": {\n "role": "USER",\n "parts": { "text": "Why is the sky blue?" }\n }\n }\'\n') File /opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2517, in InteractiveShell.run_cell_magic(self, magic_name, line, cell) 2515 with self.builtin_trap: 2516 args = (magic_arg_s, cell) -> 2517 result = fn(*args, **kwargs) 2519 # The code below prevents the output from being displayed 2520 # when using magics with decorator @output_can_be_silenced 2521 # when the last Python token in the expression is a ';'. 2522 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False): File /opt/conda/lib/python3.10/site-packages/IPython/core/magics/script.py:154, in ScriptMagics._make_script_magic.<locals>.named_script_magic(line, cell) 152 else: 153 line = script --> 154 return self.shebang(line, cell) File /opt/conda/lib/python3.10/site-packages/IPython/core/magics/script.py:314, in ScriptMagics.shebang(self, line, cell) 309 if args.raise_error and p.returncode != 0: 310 # If we get here and p.returncode is still None, we must have 311 # killed it but not yet seen its return code. We don't wait for it, 312 # in case it's stuck in uninterruptible sleep. -9 = SIGKILL 313 rc = p.returncode or -9 --> 314 raise CalledProcessError(rc, cell) CalledProcessError: Command 'b'\nMODEL_ID="gemini-1.0-pro"\n\ncurl -X POST \\\n -H "Authorization: Bearer $(gcloud auth print-access-token)" \\\n -H "Content-Type: application/json" \\\n https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:streamGenerateContent \\\n -d \'{\n "contents": {\n "role": "USER",\n "parts": { "text": "Why is the sky blue?" }\n }\n }\'\n'' returned non-zero exit status 3.

Premkumar B. · Reviewed over 2 years ago

We do not ensure the published reviews originate from consumers who have purchased or used the products. Reviews are not verified by Google.