parent
3cd9cdf22f
commit
5bb2e22d42
@ -1,17 +1,22 @@
|
||||
from pathlib import Path
|
||||
|
||||
# 阿里云中用来调用deepseek r1的密钥
|
||||
API_KEY = "sk-01d13a39e09844038322108ecdbd1bbc"
|
||||
|
||||
# 固定配置项
|
||||
MODEL_R1 = "deepseek-r1"
|
||||
MODEL_V3 = "deepseek-v3"
|
||||
# 阿里云中用来调用deepseek r1的密钥
|
||||
MODEL_API_KEY = "sk-01d13a39e09844038322108ecdbd1bbc"
|
||||
MODEL_NAME = "deepseek-r1"
|
||||
#MODEL_NAME='qwen-plus'
|
||||
MODEL_URL='https://dashscope.aliyuncs.com/compatible-mode/v1'
|
||||
|
||||
# 华为云
|
||||
HW_API_KEY='2R7vrjfIZO1chcfk4V3zDscx2Ms4I4kdoY7XSFnxa8Z2RNfAztg8qrXXKkwJGZWvMtS4qnN782WmaY4xZfMhyg'
|
||||
HW_API_URL= url = "https://infer-modelarts-cn-southwest-2.modelarts-infer.com/v1/infers/952e4f88-ef93-4398-ae8d-af37f63f0d8e/v1/chat/completions"
|
||||
HW_MODEL_NAME='DeepSeek-R1'
|
||||
|
||||
# 阿里云的配置信息
|
||||
ALY_AK='LTAI5tE4tgpGcKWhbZg6C4bh'
|
||||
ALY_SK='oizcTOZ8izbGUouboC00RcmGE8vBQ1'
|
||||
|
||||
# 正确路径拼接方式
|
||||
mdWorkingPath = Path(__file__).parent / 'md-file' / 'readme'
|
||||
DEFAULT_TEMPLATE = mdWorkingPath / 'default.md' # 使用 / 运算符
|
||||
DEFAULT_OUTPUT_DIR = mdWorkingPath / 'output' # 使用 / 运算符
|
||||
|
||||
# print(f"模板路径:{DEFAULT_TEMPLATE}")
|
||||
# print(f"输出目录:{DEFAULT_OUTPUT_DIR}")
|
||||
DEFAULT_OUTPUT_DIR = mdWorkingPath / 'output' # 使用 / 运算符
|
@ -0,0 +1,4 @@
|
||||
CREATE (r1:Rectangle {id: 1, length: 10, width: 7.5, description: '小长方形'})
|
||||
CREATE (big:Rectangle {id: 2, length: 30, width: 17.5, perimeter: 95, description: '由7个小长方形拼接而成的大长方形'})
|
||||
CREATE (r1)-[:PART_OF {quantity: 3, orientation: '横向'}]->(big)
|
||||
CREATE (r1)-[:PART_OF {quantity: 4, orientation: '纵向'}]->(big)
|
@ -0,0 +1,32 @@
|
||||
# coding=utf-8
|
||||
|
||||
import requests
|
||||
import json
|
||||
|
||||
import urllib3
|
||||
|
||||
from Config import *
|
||||
if __name__ == '__main__':
|
||||
# 禁止警告
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
# Send request.
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer '+HW_API_KEY # 把yourApiKey替换成真实的API Key
|
||||
}
|
||||
data = {
|
||||
"model": HW_MODEL_NAME,
|
||||
"max_tokens": 20,
|
||||
"messages": [
|
||||
{"role": "system", "content": "You are a helpful assistant."},
|
||||
{"role": "user", "content": "你好"}
|
||||
],
|
||||
"stream": False,
|
||||
"temperature": 1.0
|
||||
}
|
||||
resp = requests.post(HW_API_URL, headers=headers, data=json.dumps(data), verify=False)
|
||||
|
||||
# Print result.
|
||||
print(resp.status_code)
|
||||
print(resp.text)
|
Binary file not shown.
Loading…
Reference in new issue