forked from FoundationAgents/OpenManus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntitled-1.py
More file actions
38 lines (32 loc) · 1.02 KB
/
Untitled-1.py
File metadata and controls
38 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Run this model in Python
> pip install azure-ai-inference
"""
import os
from azure.ai.inference import ChatCompletionsClient
from azure.ai.inference.models import (
AssistantMessage,
ImageContentItem,
ImageUrl,
SystemMessage,
TextContentItem,
ToolMessage,
UserMessage,
)
from azure.core.credentials import AzureKeyCredential
# To authenticate with the model you will need to generate a personal access token (PAT) in your GitHub settings.
# Create your PAT token by following instructions here: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
client = ChatCompletionsClient(
endpoint="https://models.inference.ai.azure.com",
credential=AzureKeyCredential(os.environ["GITHUB_TOKEN"]),
)
response = client.complete(
messages=[
UserMessage(
content=[
TextContentItem(text="INSERT_INPUT_HERE"),
]
),
],
model="DeepSeek-R1",
)
print(response.choices[0].message.content)