Commit Graph

390 Commits (27cef0870d41744f8b72e3be44b273fc741382fc)
 

Author SHA1 Message Date
Harrison Chase 27cef0870d
bump version to 0.0.67 (#689) 1 year ago
Samantha Whitmore 77e3d58922
ConversationEntityMemory: Chain which uses an entity extraction & sum… (#678)
…marization prompt to maintain a key-value store of memory information

cc @devennavani

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
1 year ago
Ikko Eltociear Ashimine 64580259d0
Fix typo in hyde.ipynb (#688)
therefor -> therefore
1 year ago
dham e04b063ff4
add faiss local saving/loading (#676)
- This uses the faiss built-in `write_index` and `load_index` to save
and load faiss indexes locally
- Also fixes #674
- The save/load functions also use the faiss library, so I refactored
the dependency into a function
1 year ago
Harrison Chase e45f7e40e8
Harrison/few shot yaml (#682)
Co-authored-by: vintro <77507980+vintrocode@users.noreply.github.com>
1 year ago
Harrison Chase a2eeaf3d43
strip whitespace (#680) 1 year ago
Will Olson 2f57d18b25
Update hyperlink in Custom Prompt Template page (#677)
The current link points to a non-existent page. I've updated the link to
match what is on the "Create a custom example selector" page.

<img width="584" alt="Screen Shot 2023-01-21 at 10 33 05 AM"
src="https://user-images.githubusercontent.com/6773706/213879535-d8f2953d-ac37-448d-9b32-fdeb7b73cc32.png">
1 year ago
Harrison Chase 3d41af0aba
Harrison/load tools kwargs (#681)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
1 year ago
trigaten 90e4b6b040
Create CITATION.cff (#672)
You may want to add doi/orcid

Followed this:
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files
1 year ago
Harrison Chase 236ae93610
bump version to 0066 (#667) 1 year ago
Harrison Chase 0b204d8c21
Harrison/quadrant (#665)
Co-authored-by: Kacper Łukawski <kacperlukawski@users.noreply.github.com>
1 year ago
Harrison Chase 983b73f47c
add search kwargs (#664) 1 year ago
vertinski 65f3a341b0
Prompt fix for empty intermediate steps in summarization (#660)
Adding quotation marks around {text} avoids generating empty or
completely random responses from OpenAI davinci-003. Empty or completely
unrelated intermediate responses in summarization messes up the final
result or makes it very inaccurate.
The error from OpenAI would be: "The model predicted a completion that
begins with a stop sequence, resulting in no output. Consider adjusting
your prompt or stop sequences."
This fix corrects the prompting for summarization chain. This works on
API too, the images are for demonstrative purposes.
This approach can be applied to other similar prompts too. 

Examples:

1) Without quotation marks
![Screenshot from 2023-01-20
07-18-19](https://user-images.githubusercontent.com/22897470/213624365-9dfc18f9-5f3f-45d2-abe1-56de67397e22.png)

2) With quotation marks
![Screenshot from 2023-01-20
07-18-35](https://user-images.githubusercontent.com/22897470/213624478-c958e742-a4a7-46fe-a163-eca6326d9dae.png)
1 year ago
iocuydi 69998b5fad
Add ids parameter for pinecone from_texts / add_texts (#659)
Allow optionally specifying a list of ids for pinecone rather than
having them randomly generated.
This also permits editing the embedding/metadata of existing pinecone
entries, by id.
1 year ago
Harrison Chase 54d7f1c933
fix caching (#658) 1 year ago
Harrison Chase d0fdc6da11
Harrison/bing wrapper (#656)
Co-authored-by: Enrico Shippole <henryshippole@gmail.com>
1 year ago
iocuydi 207e319a70
Add search_kwargs option for VectorDBQAWithSourcesChain (#657)
Allows for passing additional vectorstore params like namespace, etc. to
VectorDBQAWithSourcesChain

Example:
`chain = VectorDBQAWithSourcesChain.from_llm(OpenAI(temperature=0),
vectorstore=store, search_kwargs={"namespace": namespace})`
1 year ago
Charles Frye bfb23f4608
typo bugfixes in getting started with prompts (#651)
tl;dr: input -> word, output -> antonym, rename to dynamic_prompt
consistently

The provided code in this example doesn't run, because the keys are
`word` and `antonym`, rather than `input` and `output`.

Also, the `ExampleSelector`-based prompt is named `few_shot_prompt` when
defined and `dynamic_prompt` in the follow-up example. The former name
is less descriptive and collides with an earlier example, so I opted for
the latter.

Thanks for making a really cool library!
1 year ago
John 3adc5227cd
typo (#650) 1 year ago
Harrison Chase 052c361031
pinecone docstring (#654) 1 year ago
Harrison Chase d54fd20ba4
bump version to 0065 (#646) 1 year ago
Harrison Chase 30abfc41c2
add instructions for saving loading (#642) 1 year ago
Harrison Chase 95720adff5
Add documentation for custom prompts for Agents (#631) (#640)
- Added a comment interpreting regex for `ZeroShotAgent`
- Added a note to the `Custom Agent` notebook

Co-authored-by: Sam Ching <samuel@duolingo.com>
1 year ago
Harrison Chase 6be5f4e4c4
Harrison/sql db chain (#641)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
1 year ago
Chetanya Rastogi b550f57912
Fix the env variable for OpenAI Base Url (#639)
For using Azure OpenAI API, we need to set multiple env vars. But as can
be seen in openai package
[here](48b69293a3/openai/__init__.py (L35)),
the env var for setting base url is named `OPENAI_API_BASE` and not
`OPENAI_API_BASE_URL`. This PR fixes that part in the documentation.
1 year ago
Harrison Chase 4d4cff0530
Harrison/cohere experimental (#638)
Co-authored-by: inyourhead <44607279+xettrisomeman@users.noreply.github.com>
1 year ago
Sasmitha Manathunga 5c97f70bf1
Fix CohereError: embed is not an available endpoint on this model (#637)
Running the Cohere embeddings example from the docs:

```python
from langchain.embeddings import CohereEmbeddings
embeddings = CohereEmbeddings(cohere_api_key= cohere_api_key)

text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_result = embeddings.embed_documents([text])
```

I get the error:

```bash
CohereError(message=res['message'], http_status=response.status_code, headers=response.headers)      
cohere.error.CohereError: embed is not an available endpoint on this model
```

This is because the `model` string is set to `medium` which is not
currently available.

From the Cohere docs:

> Currently available models are small and large (default)
1 year ago
Francis b374d481c8
fix typo (#636)
there is a small typo in one of the docs.
1 year ago
Francisco Ingham b929fd9f59
Exclude reference to 'example' in api prompt (#629)
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>
1 year ago
Harrison Chase 08400f5542
version bump to 0.0.64 (#624) 1 year ago
Steven Hoelscher a5999351cf
chore: add release workflow (#360)
Adds release workflow that (1) creates a GitHub release and (2)
publishes built artifacts to PyPI

**Release Workflow**
1. Checkout `master` locally and cut a new branch
1. Run `poetry version <rule>` to version bump (e.g., `poetry version
patch`)
1. Commit changes and push to remote branch
1. Ensure all quality check workflows pass
1. Explicitly tag PR with `release` label
1. Merge to mainline

At this point, a release workflow should be triggered because:
* The PR is closed, targeting `master`, and merged
* `pyproject.toml` has been detected as modified
* The PR had a `release` label

The workflow will then proceed to build the artifacts, create a GitHub
release with release notes and uploaded artifacts, and publish to PyPI.

Example Workflow run:
https://github.com/shoelsch/langchain/actions/runs/3711037455/jobs/6291076898
Example Releases: https://github.com/shoelsch/langchain/releases

--

Note, this workflow is looking for the `PYPI_API_TOKEN` secret, so that
will need to be uploaded to the repository secrets. I tested uploading
as far as hitting a permissions issue due to project ownership in Test
PyPI.
1 year ago
Harrison Chase 3d43906572
Harrison/new api chain (#623)
Co-authored-by: Francisco Ingham <fpingham@gmail.com>
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>
1 year ago
Harrison Chase 1c71fadfdc
more complex sql chain (#619)
add a more complex sql chain that first subsets the necessary tables
1 year ago
Harrison Chase 49b3d6c78c
Harrison/wiki update (#622)
Co-authored-by: Rubens Mau <rubensmau@gmail.com>
1 year ago
Harrison Chase 1ac3319e45
simplify parsing of the final answer (#621) 1 year ago
Harrison Chase 2a54e73fec
bump version to 0063 (#616) 1 year ago
Harrison Chase 57bbc5d6da
improve css (#615) 1 year ago
Nicolas 91d7fd20ae
feat: add custom prompt for QAEvalChain chain (#610)
I originally had only modified the `from_llm` to include the prompt but
I realized that if the prompt keys used on the custom prompt didn't
match the default prompt, it wouldn't work because of how `apply` works.

So I made some changes to the evaluate method to check if the prompt is
the default and if not, it will check if the input keys are the same as
the prompt key and update the inputs appropriately.

Let me know if there is a better way to do this.

Also added the custom prompt to the QA eval notebook.
1 year ago
Francisco Ingham 1787c473b8
Custom prompt option for llm_bash and api chains (#612)
Co-authored-by: lesscomfortable <pancho_ingham@hotmail.com>
1 year ago
Harrison Chase 67808bad0e
expose more serpapi parameters (#609) 1 year ago
Nicolas b7225fd010
docs: fix small typo (#611) 1 year ago
Harrison Chase e9301bf833
bump version to 0.0.62 (#607) 1 year ago
Harrison Chase 9f9afbb6a8
add custom prompt for LLMMathChain and SQLDatabase chain (#605) 1 year ago
Smit Shah a87a2aacaa
[Minor Fix] Fix spacy TextSplitter init (#606) 1 year ago
Sasmitha Manathunga 3e55f1474e
docs: fix typo (#604) 1 year ago
babbldev b5eb91536a
Added filter argument to pinecone queries, fixes #600 (#601)
Added filter argument to similarity_search() and
similarity_search_with_score()

Co-authored-by: Sam Cartford (MBP) <cartford@hey.com>
1 year ago
Sam Ching c4c6bf6e6e
Add subsection for colab notebooks (#599)
Motivation is that these don't get lost in the Twitterverse!
1 year ago
Rukmal Weerawarana 0f544a8811
Fix minor error in LLM documentation (#602) 1 year ago
Ikko Eltociear Ashimine 60dfe58325
Fix typo in vector_db_qa.ipynb (#597)
paramter -> parameter
1 year ago
Harrison Chase 950a81399a
bump version to 61 (#596) 1 year ago