Skip to content

Commit

Permalink
[WIP] Version 4 with better open source model support and no langchain (
Browse files Browse the repository at this point in the history
#223)

* First draft without langchain

* Improved unit tests to be closer

* Fixed remaining tests

* Added new dependencies

* Refactored LLMs to allow swapping

* Added unit tests for custom embeds/llms

* Fixed langchain compatibility and updated README

* Refactored vector stores to maybe support langchain

* Addressed Matt's comments

* Finished langchain vector store

* Unit test prompt adjustments

* Added warning to README

* Fixed some typos in README

* Fixed problem for very short texts

* Made it easier to access LLM names

* Fixed text embedding errors
  • Loading branch information
whitead authored Jan 22, 2024
1 parent 84f13ea commit 3cb16f2
Show file tree
Hide file tree
Showing 14 changed files with 1,750 additions and 987 deletions.
278 changes: 118 additions & 160 deletions README.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ python-dotenv
pymupdf
build
types-requests
numpy
langchain_openai
langchain_community
faiss-cpu
22 changes: 22 additions & 0 deletions paperqa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
from .docs import Answer, Docs, PromptCollection, Doc, Text, Context
from .version import __version__
from .llms import (
LLMModel,
EmbeddingModel,
LangchainEmbeddingModel,
OpenAIEmbeddingModel,
LangchainLLMModel,
OpenAILLMModel,
LlamaEmbeddingModel,
NumpyVectorStore,
LangchainVectorStore,
SentenceTransformerEmbeddingModel,
)

__all__ = [
"Docs",
Expand All @@ -9,4 +21,14 @@
"Doc",
"Text",
"Context",
"LLMModel",
"EmbeddingModel",
"OpenAIEmbeddingModel",
"OpenAILLMModel",
"LangchainLLMModel",
"LlamaEmbeddingModel",
"SentenceTransformerEmbeddingModel",
"LangchainEmbeddingModel",
"NumpyVectorStore",
"LangchainVectorStore",
]
113 changes: 0 additions & 113 deletions paperqa/chains.py

This file was deleted.

5 changes: 1 addition & 4 deletions paperqa/contrib/zotero.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
from pathlib import Path
from typing import List, Optional, Union, cast

try:
from pydantic.v1 import BaseModel
except ImportError:
from pydantic import BaseModel
from pydantic import BaseModel

try:
from pyzotero import zotero
Expand Down
Loading

0 comments on commit 3cb16f2

Please sign in to comment.