Getting Started with the Gemini API in Gemini Platform with cURL Reviews
65532 reviews
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 больше 2 лет ago
Neeha kiran K. · Reviewed больше 2 лет ago
mudassir m. · Reviewed больше 2 лет ago
Ayan J. · Reviewed больше 2 лет ago
Om N. · Reviewed больше 2 лет ago
LAKSHMI SREEKUMAR C. · Reviewed больше 2 лет ago
Tanmay B. · Reviewed больше 2 лет ago
Viraj P. · Reviewed больше 2 лет ago
Lavanya A. · Reviewed больше 2 лет ago
Hetarth P. · Reviewed больше 2 лет ago
Shreya D. · Reviewed больше 2 лет ago
It is good
SAI GEETHA SRIVARSHINI B. · Reviewed больше 2 лет ago
Karthikeya T. · Reviewed больше 2 лет ago
Arnab D. · Reviewed больше 2 лет ago
Hema Harshitha N. · Reviewed больше 2 лет ago
Sahabaj M. · Reviewed больше 2 лет ago
Ritesh Kumar P. · Reviewed больше 2 лет ago
Good
Davinder S. · Reviewed больше 2 лет ago
vivek k. · Reviewed больше 2 лет ago
Sharon J. · Reviewed больше 2 лет ago
Ibrahim H. · Reviewed больше 2 лет ago
Suman M. · Reviewed больше 2 лет ago
Abdul W. · Reviewed больше 2 лет ago
SIVA B. · Reviewed больше 2 лет ago
Raihan T. · Reviewed больше 2 лет ago
We do not ensure the published reviews originate from consumers who have purchased or used the products. Reviews are not verified by Google.