Premiers pas avec l'API Gemini dans Agent Platform et les commandes cURL avis

65538 avis

Krushnali G. · Examiné il y a plus de 2 ans

good lab

Abhijeet C. · Examiné il y a plus de 2 ans

Shreya P. · Examiné il y a plus de 2 ans

hiba h. · Examiné il y a plus de 2 ans

Great

Anubhav s. · Examiné il y a plus de 2 ans

Gopika C. · Examiné il y a plus de 2 ans

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. · Examiné il y a plus de 2 ans

Neeha kiran K. · Examiné il y a plus de 2 ans

mudassir m. · Examiné il y a plus de 2 ans

Ayan J. · Examiné il y a plus de 2 ans

Om N. · Examiné il y a plus de 2 ans

LAKSHMI SREEKUMAR C. · Examiné il y a plus de 2 ans

Tanmay B. · Examiné il y a plus de 2 ans

Viraj P. · Examiné il y a plus de 2 ans

Lavanya A. · Examiné il y a plus de 2 ans

Hetarth P. · Examiné il y a plus de 2 ans

Shreya D. · Examiné il y a plus de 2 ans

It is good

SAI GEETHA SRIVARSHINI B. · Examiné il y a plus de 2 ans

Karthikeya T. · Examiné il y a plus de 2 ans

Arnab D. · Examiné il y a plus de 2 ans

Hema Harshitha N. · Examiné il y a plus de 2 ans

Sahabaj M. · Examiné il y a plus de 2 ans

Ritesh Kumar P. · Examiné il y a plus de 2 ans

Good

Davinder S. · Examiné il y a plus de 2 ans

vivek k. · Examiné il y a plus de 2 ans

Nous ne pouvons pas certifier que les avis publiés proviennent de consommateurs qui ont acheté ou utilisé les produits. Les avis ne sont pas vérifiés par Google.

We've temporarily disabled access to labs due to an ongoing issue. We apologize for any inconvenience this may cause. Please check back again later.

close