Skip to content

Commit 0127d2b

Browse files
Model name is a tag for langsmith traces (#770)
# Motivation We need a quick way to filter langsmith traces by model name. # Content Model name is now an attribute of CodeAgent and is added to the list of tags on the langsmith trace. # Testing Tested by running locally # Please check the following before marking your PR as ready for review
1 parent 30c016e commit 0127d2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/codegen/agents/code_agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(
6060
additional_tools=tools,
6161
**kwargs,
6262
)
63+
self.model_name = model_name
6364
self.langsmith_client = Client()
6465
self.run_id = run_id
6566
self.instance_id = instance_id
@@ -92,8 +93,8 @@ def run(self, prompt: str, thread_id: Optional[str] = None) -> str:
9293
# this message has a reducer which appends the current message to the existing history
9394
# see more https://langchain-ai.github.io/langgraph/concepts/low_level/#reducers
9495
input = {"messages": [("user", prompt)]}
95-
metadata = {"project": self.project_name}
96-
tags = []
96+
metadata = {"project": self.project_name, "model": self.model_name}
97+
tags = [self.model_name]
9798
# Add SWEBench run ID and instance ID to the metadata and tags for filtering
9899
if self.run_id is not None:
99100
metadata["swebench_run_id"] = self.run_id

0 commit comments

Comments
 (0)