Skip to content

Langsmith prompt templates #169

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Langsmith prompt templates #169

wants to merge 2 commits into from

Conversation

mbertrand
Copy link
Member

@mbertrand mbertrand commented Apr 28, 2025

What are the relevant tickets?

Part of https://github.com/mitodl/hq/issues/7192.
The tutorbot prompts will be handled later.

Description (What does it do?)

  • Adds a new optional setting, LANGSMITH_API_KEY
  • Modifies the way system prompts are assigned to chatbots:
    a) Get from hardcoded values if LangSmith is not enabled; otherwise:
    b) Get from the cache if present
    c) Get from langsmith if present
    d) Create and return the prompt value in langsmith if not already present, and set the cache too.

How can this be tested?

  • Try out the various AI tabs without LANGSMITH_API_KEY set, the chatbots should work same as before.
  • Create a free personal langsmith account at https://smith.langchain.com/
  • Obtain an API key and add it to your .env file as LANGSMITH_API_KEY
  • Restart containers and try out the chatbots again, they should still work.
  • In the langsmith UI, choose the "Prompts" tool, You should see prompts for the chatbots you tried.

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

Successfully merging this pull request may close these issues.

1 participant