Silvano Cerza
56d033e7e7
Add back hardcoded default templates ( #4998 )
2023-05-24 16:50:11 +02:00
ZanSara
949b1b63b3
PromptHub integration in PromptNode
( #4879 )
...
* initial integration
* upgrade of prompthub
* fix get_prompt_template
* feedback
* add prompthub-py to dependencies
* tests
* mypy
* stray changes
* review feedback
* missing init
* fix test
* move logic in prompttemplate
* linting
* bugfixes
* fix unit tests
* fix cache
* simplify prompttemplate init
* remove unused function
* removing wrong params
* try remove all instances of prompt names
* more tests
* fix agent tests
* more tests
* fix tests
* pylint
* comma
* black
* fix test
* docstring
* review feedback
* review feedback
* fix mocks
* mypy
* fix mocks
* fix reference to missing templates
* feedback
* remove direct references to default template var
* tests
* Update haystack/nodes/prompt/prompt_node.py
Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
---------
Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
2023-05-23 15:22:58 +02:00
Silvano Cerza
9398183447
Simplify PromptNode generation_kwargs tests ( #4975 )
2023-05-22 14:28:08 +02:00
Fanli Lin
cd2ea4bc91
feat: enable passing generation_kwargs to the PromptNode in pipeline.run() ( #4832 )
...
* add generation_kwargs
* add documentation
* enable max_new_tokens customization
* add code formatting
* add unit test
* fix formatting
* test with black
* add a new unit test
* remove doc and update tests
* unpack generation_kwargs
* ix comment
* update unit test
* remove generation_kwargs
* not pass `generation_kwargs`
* update tests
* add max_length
* fix formatting
* revert
* reformatting
2023-05-22 11:45:06 +02:00
Vladimir Blagojevic
9d52998b25
feat: Add conversational agent ( #4931 )
2023-05-17 15:19:09 +02:00
Vladimir Blagojevic
4c9843017c
feat: Add agent memory ( #4829 )
2023-05-15 18:08:44 +02:00
bogdankostic
5b2ef2afd6
Revert "refactor!: Deprecate name
param in PromptTemplate
and introduce template_name
instead ( #4810 )" ( #4834 )
...
This reverts commit f660f41c0615e6b3064ef3e321f1e5a295fafc1b.
2023-05-08 11:31:04 +02:00
bogdankostic
f660f41c06
refactor!: Deprecate name
param in PromptTemplate
and introduce template_name
instead ( #4810 )
...
* Deprecate name parameter
* Adapt existing tests and uses of PromptTemplate
* Move parameter `name` to end
* Adapt existing tests
* lg update
---------
Co-authored-by: Darja Fokina <daria.f93@gmail.com>
2023-05-08 10:12:29 +02:00
Vladimir Blagojevic
1e9f4c1d50
feat: Add HF local runtime token streaming support ( #4652 )
...
* Add HF local runtime token streaming support
* Add stream and stream_handler as model kwargs
* Improve HF streaming unit tests
2023-05-02 12:50:20 +02:00
Silvano Cerza
79727ed31f
Add requests blocker fixture ( #4671 )
2023-04-14 18:01:30 +02:00
Vladimir Blagojevic
1dd6158244
fix: Add model_max_length model_kwargs parameter to HF PromptNode ( #4651 )
2023-04-14 15:40:42 +02:00
Vladimir Blagojevic
e30bc8fe5a
feat: Add GenerationConfig option to PromptNode's HuggingFace invocation layer ( #4649 )
2023-04-13 12:15:00 +02:00
Silvano Cerza
5baf2f5930
refactor: Rework invocation layers ( #4615 )
...
* Move invocation layers into separate package
* Fix circular imports
* Fix import
2023-04-11 11:04:29 +02:00
Silvano Cerza
c3abf73332
refactor: Rework prompt tests ( #4600 )
...
* Rework some PromptNode and PromptModel tests
* Remove duplicate code in PromptNode
* Fix mypy
* Fix test cause of missing fixture
* Revert "Fix mypy"
This reverts commit e530295a06cb260d9a8bd89679534958cb3d9776.
* Revert "Remove duplicate code in PromptNode"
This reverts commit 4a678ae81504dcc78a737372c061d12dc8799639.
2023-04-06 14:47:44 +02:00
Vladimir Blagojevic
a8d283cfac
Fix HF stop words (single stop word) ( #4584 )
2023-04-04 14:45:10 +02:00
Silvano Cerza
1cc4c9c651
refactor: Refactor prompt node ( #4580 )
...
* Refactor prompt structure
* Refactor prompt tests structure
* Fix pylint
* Move TestPromptTemplateSyntax to test_prompt_template.py
2023-04-03 11:49:49 +02:00
Silvano Cerza
af02803cce
Skip flaky prompt node integration test ( #4572 )
2023-04-03 09:49:30 +02:00
Agnieszka Marzec
815dcdebbd
docs: Update PromptNode API docs ( #4549 )
...
* Update docstrings
* adapt test to changed logging message
---------
Co-authored-by: Julian Risch <julian.risch@deepset.ai>
2023-03-30 14:27:44 +02:00
tstadel
f8bb270d62
feat: prompt at query time ( #4454 )
...
* use outputshapers in prompttemplate
* fix pylint
* first iteration on regex
* implement new promptnode syntax based on f-strings
* finish fstring implementation
* add additional tests
* add security tests
* fix mypy
* fix pylint
* fix test_prompt_templates
* fix test_prompt_template_repr
* fix test_prompt_node_with_custom_invocation_layer
* fix test_invalid_template
* more security tests
* fix test_complex_pipeline_with_all_features
* fix agent tests
* refactor get_prompt_template
* fix test_prompt_template_syntax_parser
* fix test_complex_pipeline_with_all_features
* allow functions in comprehensions
* break out of fstring test
* fix additional tests
* mark new tests as unit tests
* fix agents tests
* convert missing templates
* proper use of get_prompt_template
* refactor and add docstrings
* fix tests
* fix pylint
* fix agents test
* fix tests
* refactor globals
* make allowed functions configurable via env variable
* better dummy variable
* fix special alias
* don't replace special char variables
* more special chars, better docstrings
* cherrypick fix audio tests
* fix test
* rework shapers
* fix pylint
* fix tests
* add new templates
* add reference parsing
* add more shaper tests
* add tests for join and to_string
* fix pylint
* fix pylint
* fix pylint for real
* auto fill shaper function params
* fix reference parsing for multiple references
* fix output variable inference
* consolidate qa prompt template output and make shaper work per-document
* implement prompt at query time
* support serialized PromptTemplates
* fix tests
* add tests for prompt template at query time
* fix types after merge
* fix types after merge
* improve test
* add test for nested shaper syntax in pipelines
* better docstrings
* Correct copilot errors
* found another copilot error
* Another one
* introduce output_parser
* introduce output_parser
* Fix tests for output_parser update
* fix black
* fix tests
* fix tests
* fix tests
* better docstring
* better docstring
* fix test
* fix mypy
* rename RegexAnswerParser to AnswerParser
* rename RegexAnswerParser to AnswerParser
* better docstrings
* better docstrings
* fix docstring example
2023-03-27 14:10:20 +02:00
tstadel
382ca8094e
feat: PromptTemplate extensions ( #4378 )
...
* use outputshapers in prompttemplate
* fix pylint
* first iteration on regex
* implement new promptnode syntax based on f-strings
* finish fstring implementation
* add additional tests
* add security tests
* fix mypy
* fix pylint
* fix test_prompt_templates
* fix test_prompt_template_repr
* fix test_prompt_node_with_custom_invocation_layer
* fix test_invalid_template
* more security tests
* fix test_complex_pipeline_with_all_features
* fix agent tests
* refactor get_prompt_template
* fix test_prompt_template_syntax_parser
* fix test_complex_pipeline_with_all_features
* allow functions in comprehensions
* break out of fstring test
* fix additional tests
* mark new tests as unit tests
* fix agents tests
* convert missing templates
* proper use of get_prompt_template
* refactor and add docstrings
* fix tests
* fix pylint
* fix agents test
* fix tests
* refactor globals
* make allowed functions configurable via env variable
* better dummy variable
* fix special alias
* don't replace special char variables
* more special chars, better docstrings
* cherrypick fix audio tests
* fix test
* rework shapers
* fix pylint
* fix tests
* add new templates
* add reference parsing
* add more shaper tests
* add tests for join and to_string
* fix pylint
* fix pylint
* fix pylint for real
* auto fill shaper function params
* fix reference parsing for multiple references
* fix output variable inference
* consolidate qa prompt template output and make shaper work per-document
* fix types after merge
* introduce output_parser
* fix tests
* better docstring
* rename RegexAnswerParser to AnswerParser
* better docstrings
2023-03-27 12:14:11 +02:00
recrudesce
2a2226d63e
fix: Fix debug on PromptNode ( #4483 )
...
* Fix debug on PromptNode
Allow the ability to control debug output on PromptNode
* added tests, simplified code
---------
Co-authored-by: Mayank Jobanputra <mayankjobanputra@gmail.com>
2023-03-24 19:37:52 +05:30
Vladimir Blagojevic
7bb6499c29
feat: Enable PromptNode to use text-generation models ( #4349 )
2023-03-22 07:20:36 +01:00
Vladimir Blagojevic
53528c96a0
feat: Add ChatGPT PromptNode layer ( #4357 )
...
* Initial ChatGPTInvocationLayer
Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
Co-authored-by: agnieszka-m <amarzec13@gmail.com>
Co-authored-by: Sebastian <sjrl@users.noreply.github.com>
2023-03-17 14:16:41 +01:00
Sebastian
f04b2f3cee
Update test to reflect change in max token length ( #4451 )
2023-03-17 09:43:23 +01:00
Vladimir Blagojevic
2538b4cbc9
Make promptnode test unit ( #4420 )
2023-03-15 22:17:23 +01:00