Closed CharryJay closed 3 months ago
看到api文档中可以如下使用embedding模型 url = "https://api.chatanywhere.tech/v1/embeddings" payload = json.dumps({ "model": "text-embedding-3-small", "input": "The food was delicious and the waiter..." }) headers = { 'Authorization': '[key]', 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload)
请问能否像openai一样的接口调用呢embedding模型呢 from openai import OpenAI client = OpenAI() response = client.embeddings.create( input="Your text string goes here", model="text-embedding-3-small" )
可以啊 改api地址就行了
看到api文档中可以如下使用embedding模型 url = "https://api.chatanywhere.tech/v1/embeddings" payload = json.dumps({ "model": "text-embedding-3-small", "input": "The food was delicious and the waiter..." }) headers = { 'Authorization': '[key]', 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload)
请问能否像openai一样的接口调用呢embedding模型呢 from openai import OpenAI client = OpenAI() response = client.embeddings.create( input="Your text string goes here", model="text-embedding-3-small" )