Skip to content
New issue

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

怎么在langchain里面使用deepseek计算embedding? #67

Open
ShuoAndy opened this issue Jul 4, 2024 · 3 comments
Open

怎么在langchain里面使用deepseek计算embedding? #67

ShuoAndy opened this issue Jul 4, 2024 · 3 comments

Comments

@ShuoAndy
Copy link

ShuoAndy commented Jul 4, 2024

我的代码如下

from langchain_openai import ChatOpenAI, OpenAIEmbeddings
llm = ChatOpenAI(
        model='deepseek-chat', 
        openai_api_key='xxx', 
        openai_api_base='https://api.deepseek.com/v1', 
        temperature=0.85, 
        max_tokens=4000
        )
embeddings = OpenAIEmbeddings(api_key="xxx", base_url="https://api.deepseek.com/v1")

在初始化 OpenAIEmbeddings 时似乎遇到了问题:openai.APIStatusError: Error code: 418 - {'error': 'Requested Resource Not Found', 'stage': 'WAF'}
我该怎么办?

@songdo
Copy link

songdo commented Jul 6, 2024

遇到同样问题

@temberature
Copy link

Does your API support Embedding or Function Calling?
We do not support these features at this moment, but they are in our development plans.

FAQ | DeepSeek API Docs
https://platform.deepseek.com/api-docs/faq/

@jiiuluo00001
Copy link

import os

API_SECRET_KEY = "sk-16fc8d4a022841619ed3bf3434ee2e4f"
BASE_URL = "https://api.deepseek.com"

os.environ["OPENAI_API_KEY"] = API_SECRET_KEY
os.environ["OPENAI_API_BASE"] = BASE_URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants