Skip to content

Commit

Permalink
✨ Generate README-python from README.
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 14, 2023
1 parent 756a3e2 commit 7fa113f
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions README-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,13 @@ response = requests.post(
"https://api.openai.com/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}",
"Authorization": "Bearer " + os.environ["OPENAI_API_KEY"]
},
json={
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}
)
Expand All @@ -53,7 +47,7 @@ response = requests.post(
"https://api.openai.com/v1/embeddings",
headers={
"Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}",
"Content-Type": "application/json"
"Content-Type": "application/json",
},
json={
"input": "The food was delicious and the wine...",
Expand Down Expand Up @@ -100,9 +94,9 @@ import os
response = requests.post(
"https://api.mistral.ai/v1/chat/completions",
headers={
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': f"Bearer {os.environ['MISTRAL_API_KEY']}"
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": f"Bearer {os.environ['MISTRAL_API_KEY']}"
},
json={
"model": "mistral-tiny",
Expand All @@ -121,7 +115,7 @@ response = requests.post(
headers={
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": f"Bearer {os.environ['MISTRAL_API_KEY']}"
"Authorization": "Bearer " + os.environ.get("MISTRAL_API_KEY")
},
json={
"model": "mistral-embed",
Expand All @@ -140,8 +134,8 @@ import requests
import os

response = requests.post(
"https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=" + os.environ.get("GOOGLE_API_KEY"),
headers={"Content-Type": "application/json"},
"https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=" + os.environ['GOOGLE_API_KEY'],
headers={'Content-Type': 'application/json'},
json={
"contents": [
{
Expand All @@ -162,7 +156,7 @@ import requests
import os

response = requests.post(
"https://generativelanguage.googleapis.com/v1beta/models/embedding-001:generateContent?key=" + os.environ.get("GOOGLE_API_KEY"),
"https://generativelanguage.googleapis.com/v1beta/models/embedding-001:generateContent?key=" + os.environ["GOOGLE_API_KEY"],
headers={"Content-Type": "application/json"},
json={
"contents": [
Expand Down

0 comments on commit 7fa113f

Please sign in to comment.