Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
from openai import OpenAI
|
| 5 |
+
|
| 6 |
+
client = OpenAI(
|
| 7 |
+
api_key=os.environ["CometAPI_API_KEY"],
|
| 8 |
+
base_url="https://api.cometapi.com/v1/chat/completions" # important
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
resp = client.chat.completions.create(
|
| 12 |
+
model="deepseek-v3.1",
|
| 13 |
+
messages=[
|
| 14 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
| 15 |
+
{"role": "user", "content": "Summarize this PDF in 5 bullets."}
|
| 16 |
+
],
|
| 17 |
+
temperature=0.3,
|
| 18 |
+
response_format={"type": "json_object"} # for structured outputs
|
| 19 |
+
)
|
| 20 |
+
print(resp.choices[0].message.content)
|