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

feat: Expand LLM support with PromptModel, PromptNode, and PromptTemplate #3667

Merged
merged 30 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7777e21
Initial PromptNode implementation
vblagoje Nov 25, 2022
71d9376
Improve customer facing exception messages
vblagoje Dec 16, 2022
04bd3ab
PromptTemplate in YAML, add unit tests
vblagoje Dec 16, 2022
cb87c91
Integrate Aga's corrections
vblagoje Dec 16, 2022
dcd1d15
Fix mypy
vblagoje Dec 16, 2022
50f07a2
Address Julian's comments
vblagoje Dec 16, 2022
6378405
Enable PromptModel kwargs
vblagoje Dec 17, 2022
8306b4c
Rename llm package to prompt
vblagoje Dec 17, 2022
20bf77a
Minor changes
vblagoje Dec 17, 2022
c66ce14
Add language-detection, translation tasks
vblagoje Dec 17, 2022
79c8331
Handle PromptModel model_kwargs for all the complex model device layouts
vblagoje Dec 17, 2022
e59a78c
Handle model_kwargs for OpenAI inference
vblagoje Dec 18, 2022
6e48834
Rename multiple-choice template
vblagoje Dec 19, 2022
ae9c84a
Update prompt template variables regex pattern
vblagoje Dec 19, 2022
5092e1a
Cleaner quotes stripping
vblagoje Dec 19, 2022
cd67035
No f-strings in logs
vblagoje Dec 19, 2022
71f7277
Cleaner update of OpenAI optional parameters
vblagoje Dec 19, 2022
28267b6
Implement Sara's supports idea for invocation layers
vblagoje Dec 19, 2022
88907f5
model_kwargs can indeed be a Dict
vblagoje Dec 19, 2022
9f92e72
Clarify prompt template preparation before passing to model
vblagoje Dec 19, 2022
cdb9c3e
Some test don't need the real OpenAI key
vblagoje Dec 19, 2022
e237ff3
Keep only necessary # type: ignore
vblagoje Dec 19, 2022
e025248
Better handling of torch types
vblagoje Dec 19, 2022
21b5192
Checking for OPENAI_API_KEY
vblagoje Dec 19, 2022
21f366b
Minor fix
vblagoje Dec 19, 2022
5ac8634
Remove unused code path
vblagoje Dec 19, 2022
1416f69
Prevent OpenAI api_key being None
vblagoje Dec 19, 2022
701a4e9
Minor test setup change
vblagoje Dec 19, 2022
baa5769
Remove unused param in run_batch
vblagoje Dec 20, 2022
8165648
add to nodes init
ZanSara Dec 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions haystack/nodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from haystack.nodes.label_generator import PseudoLabelGenerator
from haystack.nodes.other import Docs2Answers, JoinDocuments, RouteDocuments, JoinAnswers, DocumentMerger
from haystack.nodes.preprocessor import BasePreProcessor, PreProcessor
from haystack.nodes.prompt import PromptNode, PromptTemplate, PromptModel
from haystack.nodes.query_classifier import SklearnQueryClassifier, TransformersQueryClassifier
from haystack.nodes.question_generator import QuestionGenerator
from haystack.nodes.ranker import BaseRanker, SentenceTransformersRanker
Expand Down
1 change: 1 addition & 0 deletions haystack/nodes/prompt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from haystack.nodes.prompt.prompt_node import PromptNode, PromptTemplate, PromptModel
Loading