We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
接口调用返回404 Response Status: 404 Response Text: {"error_msg": "Not Found. Please check the configuration."}
还是调用的问题?执行代码如下: class DeepSeekEmbeddingFunction(EmbeddingFunction): def init(self): self.api_url = "https://api.deepseek.com/v1/embeddings" api_key = os.getenv("DEEPSEEK_API_KEY") if not api_key: raise ValueError("DEEPSEEK_API_KEY 未设置!") self.headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }
def __call__(self, texts: List[str]) -> List[List[float]]: payload = { "input": texts, "model": "deepseek-embedding" # 确认模型名称 } print(f"Request URL: {self.api_url}") # 打印 URL print(f"Headers: {self.headers}") # 打印请求头 print(f"Payload: {payload}") # 打印请求体 resp = requests.post(self.api_url, headers=self.headers, json=payload) print(f"Response Status: {resp.status_code}") # 打印响应状态码 print(f"Response Text: {resp.text}") # 打印响应内容 if resp.status_code != 200: raise RuntimeError(f"DeepSeek API 错误:{resp.status_code} - {resp.text}") data = resp.json() # 根据实际响应结构调整提取逻辑 return [item["embedding"] for item in data["data"]]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
接口调用返回404
Response Status: 404
Response Text: {"error_msg": "Not Found. Please check the configuration."}
还是调用的问题?执行代码如下:
class DeepSeekEmbeddingFunction(EmbeddingFunction):
def init(self):
self.api_url = "https://api.deepseek.com/v1/embeddings"
api_key = os.getenv("DEEPSEEK_API_KEY")
if not api_key:
raise ValueError("DEEPSEEK_API_KEY 未设置!")
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
The text was updated successfully, but these errors were encountered: