Skip to content

Langsmith: Add envs for project/run names; fix bug with None metadata - #1524

Merged
ishaan-jaff merged 4 commits into
BerriAI:mainfrom
timothyasp:langsmith-project-env-bug-fix
Jan 19, 2024
Merged

ishaan-jaff merged 4 commits into
BerriAI:mainfrom
timothyasp:langsmith-project-env-bug-fix

Conversation

@timothyasp

Copy link
Copy Markdown
Contributor

First off - thanks for your work on this project! Been loving working with this since migrating from langchain.

--

Ran into a problem with a fresh install and trying to integrate with an existing langsmith project, if there was no metadata set on the completion, the request would silently fail when logging to langsmith.

I also added project envs for setting new project names as it's a pain to have to add metadata to every completion call.

@vercel

vercel Bot commented Jan 19, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 7:57pm

@ishaan-jaff ishaan-jaff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

run_name = metadata.get("run_name", "LLMRun")
# if not set litellm will fallback to the environment variable LANGSMITH_PROJECT, then to the default project_name = litellm-completion, run_name = LLMRun
project_name = metadata.get("project_name", self.langsmith_project)
run_name = metadata.get("run_name", self.langsmith_default_run_name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@ishaan-jaff

Copy link
Copy Markdown
Contributor

@timothyasp thanks for the contribution !

This branch was successfully deployed

1 active deployment
Preview — 9d6a8b5d Deployed Jan 19, 2024 by vercel[bot]
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

Successfully merging this pull request may close these issues.

2 participants