User Tools

Site Tools


informatica:inteligencia_artificial:openai

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:inteligencia_artificial:openai [2023/03/02 22:56] joseinformatica:inteligencia_artificial:openai [2023/03/02 23:03] (current) jose
Line 341: Line 341:
 https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb
  
 +Exportamos la key en bash:
 +  export API_KEY='sk-aslasdjkasldjasldjasldjkasldkj'
 +Dede python:
 <code> <code>
 import openai import openai
Line 382: Line 385:
 </code> </code>
  
 +Con curl:
 +  curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d '{ "model": "gpt-3.5-turbo",  "messages": [{"role": "user", "content": "Inventate una historia de un asesinato en Carabanchel"}] }' 
 + 
  
informatica/inteligencia_artificial/openai.1677797807.txt.gz · Last modified: 2023/03/02 22:56 by jose