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

dify cannot create langsmith project #12967

Open
5 tasks done
corlin opened this issue Jan 23, 2025 · 4 comments
Open
5 tasks done

dify cannot create langsmith project #12967

corlin opened this issue Jan 23, 2025 · 4 comments
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited

Comments

@corlin
Copy link

corlin commented Jan 23, 2025

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

dify create langsmith project

❌ Actual Behavior

dify cannot create langsmith project

@dosubot dosubot bot added 🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited labels Jan 23, 2025
Copy link

dosubot bot commented Jan 23, 2025

@corlin Hello there! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. I'm a bot designed to assist you while waiting for a human maintainer. Let's tackle this issue together!

When Dify fails to create a project in LangSmith, it might be due to a mismatch between the project name in Dify and LangSmith, or an issue with the API key configuration. Here are some steps to troubleshoot and resolve the issue:

  1. Verify Project Name: Ensure that the project name entered in Dify matches exactly with the one in LangSmith. Any discrepancy can lead to the project not being found.

  2. Check API Key: Make sure that the API key used is correct and has the necessary permissions. You can regenerate the API key in LangSmith and update it in Dify to ensure it's valid.

  3. Endpoint Configuration: Confirm that the endpoint URL is correctly set to https://api.smith.langchain.com.

  4. Network and Access: Ensure that there are no network issues or firewall settings blocking access to the LangSmith API from your Dify setup.

If these steps do not resolve the issue, it might be helpful to check the logs for any additional error messages that could provide more insight into the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@corlin
Copy link
Author

corlin commented Jan 23, 2025

Before the configuration, I had already registered and set up Langsmith, and tested it through Langgraph code. It was able to create projects and perform traces normally. However, based on the Dify configuration, it could not, especially for new Smith projects. Dify was unable to generate project names during the first configuration.

@crazywoola
Copy link
Member

crazywoola commented Jan 23, 2025

def get_project_url(self):
try:
run_data = RunBase(
id=uuid.uuid4(),
name="tool",
inputs={"input": "test"},
outputs={"output": "test"},
run_type=LangSmithRunType.tool,
start_time=datetime.now(),
)
project_url = self.langsmith_client.get_run_url(
run=run_data, project_id=self.project_id, project_name=self.project_name
)
return project_url.split("/r/")[0]
except Exception as e:
logger.debug(f"LangSmith get run url failed: {str(e)}")
raise ValueError(f"LangSmith get run url failed: {str(e)}")

I think you need to link an existing project.

@corlin
Copy link
Author

corlin commented Jan 23, 2025

dify/api/core/ops/langsmith_trace/langsmith_trace.py

Lines 507 to 524 in 56e15d0

def get_project_url(self):
try:
run_data = RunBase(
id=uuid.uuid4(),
name="tool",
inputs={"input": "test"},
outputs={"output": "test"},
run_type=LangSmithRunType.tool,
start_time=datetime.now(),
)

     project_url = self.langsmith_client.get_run_url( 
         run=run_data, project_id=self.project_id, project_name=self.project_name 
     ) 
     return project_url.split("/r/")[0] 
 except Exception as e: 
     logger.debug(f"LangSmith get run url failed: {str(e)}") 
     raise ValueError(f"LangSmith get run url failed: {str(e)}") 

I think you need to link an existing project.

The Langsmith management interface does not have a feature entry for creating projects. The existing rule is that the program passes the project name, and a Langsmith project is automatically created; if no project name is specified, it defaults to 'default'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited
Projects
None yet
Development

No branches or pull requests

2 participants