Skip to content

Commit 4dc6474

Browse files
committed
PR feedback
1 parent a0eb654 commit 4dc6474

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

langchain/langchain_interceptor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import annotations
22

3+
from typing import Any, Mapping, Protocol, Type
34
from temporalio import workflow, worker, converter, client, api, activity
45

56
with workflow.unsafe.imports_passed_through():
67
from contextlib import contextmanager
7-
from typing import Any, Mapping, Protocol, Type
88
from langsmith import trace, tracing_context
99
from langsmith.run_helpers import get_current_run_tree
1010

langchain/worker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ async def main():
3030

3131

3232
if __name__ == "__main__":
33-
loop = asyncio.get_event_loop()
33+
loop = asyncio.new_event_loop()
34+
asyncio.set_event_loop(loop)
3435
try:
3536
loop.run_until_complete(main())
3637
except KeyboardInterrupt:

langchain/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

2+
from typing import List
3+
from datetime import timedelta
4+
import asyncio
25

36
from temporalio import workflow
47

58
with workflow.unsafe.imports_passed_through():
6-
import asyncio
79
from dataclasses import dataclass
8-
from datetime import timedelta
9-
from typing import List
1010
from activities import TranslateParams, translate_phrase
1111

1212
@workflow.defn

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ gevent = ["gevent==25.4.2 ; python_version >= '3.8'"]
3838
langchain = [
3939
"langchain>=0.1.7,<0.2 ; python_version >= '3.8.1' and python_version < '4.0'",
4040
"langchain-openai>=0.0.6,<0.0.7 ; python_version >= '3.8.1' and python_version < '4.0'",
41+
"langsmith>=0.1.22,<0.2 ; python_version >= '3.8.1' and python_version < '4.0'",
4142
"openai>=1.4.0,<2",
4243
"fastapi>=0.105.0,<0.106",
4344
"tqdm>=4.62.0,<5",

0 commit comments

Comments
 (0)