[ python中使用文心义言 ]
发表评论
155 views
分类目录归档:backend
注册
pip install dashscope
配置环境变量
export DASHSCOPE_API_KEY=YOUR_DASHSCOPE_API_KEY
运行
import random
from http import HTTPStatus
import dashscope
dashscope.api_key = "sk-4607ca0bb63d4646b8aeaca909091a9f"
def call_with_messages():
messages = [{&qu




立即更新情景模式时,需要开启全局模式, 上外网才行
https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt
1.解压rar文件后

2.进入需要使用的方法(当前使用的是3号方法到2025年)
3.复制jetbra文件夹到一个全英文路径的目录下, 随后进入,执行文件夹scripts内的
sudo bash install.sh

-jabash xxxx.deb
中途选择安装路径
su
cd
cat .bashrc
source .bashrc
复制conda init 内容到需要用到conda的用户那个 .bashrc文件
再执行source .bashrc更新即可
解决下载慢问题
# define an alias for the specific python version used in this file.
FROM python:3.11.3-slim-bullseye as python
# Python build stage
FROM python as python-build-stage
ARG BUILD_ENVIRONMENT=local
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.from typing import Any, List, Optional
from pydantic import BaseModel, Field, Json
class BarModel(BaseModel):
whatever: int
class FooBarModel(BaseModel):
banana: Optional[float] = 1.1
foo: str = Field(serialization_alias='foo_alias')
bar: BarModel
m = Foo {
"port": "3000",
"adminAccount": "1743309009@qq.com",
"timeout":120000,
"db": {
"servername": "mongo",
"DATABASE": "yapi",
"h主要处理
def get_Incident_view() -> HttpResponse:
status_list = [choices[0] for choices in RepairOrder.STATUS.choices if choices[0] != RepairOrder.STATUS.CHECKED_OUT]
# repair_order_part_queryset = []
# dict = {
# rop_r.repair_order : rop_r
# for rop_r in RepairOrder# example of usage grafana/loki api when you need push any log/message from your python scipt
import requests
import json
import datetime
import pytz
host = 'somehost'
curr_datetime = datetime.datetime.now(pytz.timezone('Asia/Yekaterinburg'))
curr_datetime