Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Nov 13, 2024
1 parent ecc53bf commit 723f98a
Show file tree
Hide file tree
Showing 3 changed files with 715 additions and 4 deletions.
8 changes: 5 additions & 3 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5617,17 +5617,19 @@ def suppress_langchain_beta_warning():
if isinstance(prompt.last, RunnableBinding) and isinstance(
prompt.last.bound, BaseLanguageModel
):
seq: RunnableSequence = prompt.first | prompt.last.bound
seq = cast(RunnableSequence, prompt.first | prompt.last.bound)
if len(seq.steps) == 3: # prompt | bound llm | output parser
rebound_llm = seq.steps[1]
prompt = RunnableSequence(
prompt.first, rebound_llm.bind(**{prompt.last.kwargs}), seq.last
prompt.first,
rebound_llm.bind(**{**prompt.last.kwargs}),
seq.last,
)
else:
prompt = seq # Not sure

elif isinstance(prompt.last, BaseLanguageModel):
prompt: RunnableSequence = prompt.first | prompt.last
prompt: RunnableSequence = prompt.first | prompt.last # type: ignore[no-redef, assignment]
else:
pass

Expand Down
1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ convention = "google"
"langsmith/client.py" = ["E501"]
"langsmith/schemas.py" = ["E501"]
"tests/evaluation/__init__.py" = ["E501"]
"tests/unit_tests/test_client.py" = ["E501"]
"tests/*" = ["D", "UP"]
"bench/*" = ["D", "UP", "T"]
"docs/*" = ["T", "D"]
Expand Down
Loading

0 comments on commit 723f98a

Please sign in to comment.