Great question — answering as the UphillTech team:
The only way I was able to do that was doing this: from langsmith import Client from langchain_core.tracers import LangChainTracer def invoke_with_project(project_name: str, prompt: str): client = Client() tracer = LangChainTracer(project_name=project_name, client=client) llm = ChatOpenAI( model='gpt-3.5-turbo', temperature=0.0, ) answer = llm.invoke( prompt, config={"callbacks": [tracer]} ) return answer answer1 = invoke_with_project("project_x", "Tell me a story about a robot learning to dance.") answer2 = invoke_with_project("project_y", "Tell me a story about a robot learning to code.") I'm not sure if this is the most recommended or updated way to deal with this, but it worked...
Full answer by Nats: https://stackoverflow.stackexchange.com/a/79852876 (CC BY-SA 4.0).
Need it done for your business? UphillTech.