Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base chain type hints #7680

Merged
merged 2 commits into from
Jul 25, 2023
Merged

Conversation

stakodiak
Copy link
Contributor

Addresses #7578. run() can return dictionaries, Pydantic objects or strings, so the type hints should reflect that. See the chain from create_structured_output_chain for an example of a non-string return type from run().

I've updated the BaseLLMChain return type hint from str to Any. Although, the differences between run() and __call__() seem less clear now.

CC: @baskaryan

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Addresses langchain-ai#7578. `run()` can return dictionaries, Pydantic objects or strings, so the type hints should reflect that. See the chain from `create_structured_output_chain` for an example of a non-string return type from `run()`.
@vercel
Copy link

vercel bot commented Jul 13, 2023

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

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2023 2:30am

@dosubot dosubot bot added the 🤖:improvement Medium size change to existing code to handle new use-cases label Jul 13, 2023
@baskaryan
Copy link
Collaborator

thanks @stakodiak!

@baskaryan baskaryan merged commit a7efa95 into langchain-ai:master Jul 25, 2023
bdonkey added a commit to bdonkey/langchain that referenced this pull request Jul 26, 2023
* master: (496 commits)
  New enterprise support form (langchain-ai#8254)
  Add LLMChain example of memory with chat models (langchain-ai#8250)
  Update Broken Links (langchain-ai#8247)
  Remove operator overloading for BaseMessage (langchain-ai#8245)
  Update references (langchain-ai#8243)
  Bug Fix langchain-ai#6462 (langchain-ai#8241)
  bump 242 (langchain-ai#8238)
  Add/faiss test score threshold (langchain-ai#8224)
  use logger instead of logging (langchain-ai#8225)
  Refactored `requests` (langchain-ai#8203)
  Update Integrations links (langchain-ai#8206)
  Update base chain type hints (langchain-ai#7680)
  feat: temp fixed Could not parse LLM output on agents folder (langchain-ai#7746)
  add Hybrid retriever that not require any external service (langchain-ai#8108)
  Fixed grammar in LLM models documentation (langchain-ai#8210)
  Update supabase.py, add filter to query (matches latest supabase docs & js) (langchain-ai#7721)
  Fixed sparql SELECT and UPDATE query function (langchain-ai#7758)
  Add async support for transform chain (langchain-ai#8205)
  Added stop sequence support to replicate (langchain-ai#8107)
  Add etherscan document loader (langchain-ai#7943)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants