Kor

Latest version: v3.0.0

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 4

0.7.0

What's Changed


* All the internal schema relies on pydantic for validation! This change may cause your code to crash if you've had typos!
eyurtsev in https://github.com/eyurtsev/kor/pull/117


* Allow customizing the prompt by eyurtsev in https://github.com/eyurtsev/kor/pull/121

python
from langchain.prompts import PromptTemplate

DEFAULT_PROMPT_TEMPLATE = PromptTemplate(
input_variables=["format_instructions", "type_description"],
template=(
"Write some stuff here n\n"
"{type_description}\n\n"
"{format_instructions}"
"Suffix heren\n"
),
)


chain = create_extraction_chain(llm, schema, instruction_template=DEFAULT_PROMPT_TEMPLATE)

print(chain.prompt.format_prompt(text='hello').to_string())


**Full Changelog**: https://github.com/eyurtsev/kor/compare/0.6.1...0.7.0

0.6.1

What's Changed

Bug fixes:

* Apply input formatter to user text, not only examples by eyurtsev in https://github.com/eyurtsev/kor/pull/119

New Contributors
* rishabhjain1198 made their first contribution in https://github.com/eyurtsev/kor/pull/118

**Full Changelog**: https://github.com/eyurtsev/kor/compare/0.6.0...0.6.1

0.6.0

What's Changed

* Visitors accept **kwargs
* Type-descriptors have been changed to be immutable
* Added more documentation

**Full Changelog**: https://github.com/eyurtsev/kor/compare/0.5.1...0.6.0

0.5.1

What's Changed

* Add input formatting argument to [create_extraction_chain](https://eyurtsev.github.io/kor/generated/kor.html#kor.create_extraction_chain). This may help make the extraction more robust for text containing a lot of whitespace / multiple paragraphs.
* Added kor.__version__
* Added more sphinx documentation

**Full Changelog**: https://github.com/eyurtsev/kor/compare/0.5.0...0.5.1

0.5.0

What's Changed

* Added a pydantic adapter (https://github.com/eyurtsev/kor/pull/91) which can be used to generate schema and to do validation.
* The adapter handles only a few common primitives for schema.
* Example usage here: https://eyurtsev.github.io/kor/validation.html

**Full Changelog**: https://github.com/eyurtsev/kor/compare/0.4.0...0.5.0

0.4.0

What's Changed

* Integration with Langchain via an LLMChain
* Added support for CSV, JSON encodings
* Swapped default encoding to use CSV (less flexible, but anecdotally more accurate)
* All schema nodes are no longer assumed to be lists by default. Instead the `many` attribute has been set to `False`
* However, due to lack of validation and details of XML encoding, XML encoding will still output everything as lists.
* Renamed type descriptors

Breaking Changes

Public API for extraction has changed completely to instead expose an LLMChain.

New Contributors
* tomdyson made their first contribution in https://github.com/eyurtsev/kor/pull/74

**Full Changelog**: https://github.com/eyurtsev/kor/compare/0.3.0...0.4.0

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.