informatica:inteligencia_artificial:openai
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
informatica:inteligencia_artificial:openai [2023/03/01 22:19] – created jose | informatica:inteligencia_artificial:openai [2023/03/02 23:03] (current) – jose | ||
---|---|---|---|
Line 332: | Line 332: | ||
Varios servicios Machine Learning de Amazon:\\ | Varios servicios Machine Learning de Amazon:\\ | ||
https:// | https:// | ||
+ | |||
+ | |||
+ | ====== Nueva API ====== | ||
+ | En Marzo de 2023 salió el nuevo modelo gpt-3.5-turbo con su API | ||
+ | |||
+ | Fuente:\\ | ||
+ | https:// | ||
+ | https:// | ||
+ | |||
+ | Exportamos la key en bash: | ||
+ | export API_KEY=' | ||
+ | Dede python: | ||
+ | < | ||
+ | import openai | ||
+ | |||
+ | response = openai.ChatCompletion.create( | ||
+ | model=" | ||
+ | messages=[ | ||
+ | {" | ||
+ | {" | ||
+ | {" | ||
+ | {" | ||
+ | ] | ||
+ | ) | ||
+ | |||
+ | print(response) | ||
+ | </ | ||
+ | |||
+ | Respuesta: | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Con curl: | ||
+ | curl https:// | ||
+ | |||
informatica/inteligencia_artificial/openai.1677709148.txt.gz · Last modified: 2023/03/01 22:19 by jose