Skip to main content

Experimental components and features for the Haystack LLM framework.

Project description

PyPI - Version PyPI - Python Version Tests Project release on PyPi Hatch project Checked with mypy

Haystack experimental package

The haystack-experimental package provides Haystack users with access to experimental features without immediately committing to their official release. The main goal is to gather user feedback and iterate on new features quickly.

Installation

For simplicity, every release of haystack-experimental will ship all the available experiments at that time. To install the latest experimental features, run:

$ pip install -U haystack-experimental

[!IMPORTANT] The latest version of the experimental package is only tested against the latest version of Haystack. Compatibility with older versions of Haystack is not guaranteed.

Experiments lifecycle

Any experimental feature will be removed from haystack-experimental after a period of 3 months. After this time, the experiment will be either:

  • Merged into Haystack core and published in the next minor release
  • Released as a Core Integration,
  • Dropped.

Experiments catalog

The latest version of the package contains the following experiments:

Name Type Experiment end date
EvaluationHarness Evaluation orchestrator August 2024
OpenAIFunctionCaller Function Calling Component August 2024

Usage

Experimental new features can be imported like any other Haystack integration package:

from haystack.dataclasses import ChatMessage
from haystack_experimental.components.generators import FoobarGenerator

c = FoobarGenerator()
c.run([ChatMessage.from_user("What's an experiment? Be brief.")])

Experiments can also override existing Haystack features. For example, users can opt into an experimental type of Pipeline by just changing the usual import:

# from haystack import Pipeline
from haystack_experimental import Pipeline

pipe = Pipeline()
# ...
pipe.run(...)

Documentation

Documentation for haystack-experimental can be found here.

Implementation

Experiments should replicate the namespace of the core package. For example, a new generator:

# in haystack_experimental/components/generators/foobar.py

from haystack import component


@component
class FoobarGenerator:
    ...

When the experiment overrides an existing feature, the new symbol should be created at the same path in the experimental package. This new symbol will override the original in haystack-ai: for classes, with a subclass and for bare functions, with a wrapper. For example:

# in haystack_experiment/src/haystack_experiment/core/pipeline/pipeline.py

from haystack.core.pipeline import Pipeline as HaystackPipeline


class Pipeline(HaystackPipeline):
	# Any new experimental method that doesn't exist in the original class
	def run_async(self, inputs) -> Dict[str, Dict[str, Any]]:
		...

	# Existing methods with breaking changes to their signature, like adding a new mandatory param
    def to_dict(new_param: str) -> Dict[str, Any]:
        # do something with the new parameter
        print(new_param)
        # call the original method
        return super().to_dict()

Contributing

Direct contributions to haystack-experimental are not expected, but Haystack maintainers might ask contributors to move pull requests that target the core repository to this repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haystack_experimental-0.0.2.dev0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

haystack_experimental-0.0.2.dev0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file haystack_experimental-0.0.2.dev0.tar.gz.

File metadata

File hashes

Hashes for haystack_experimental-0.0.2.dev0.tar.gz
Algorithm Hash digest
SHA256 9fc11a025df3212446c737d23cdcb2b6ceac6e90132c83ab988946a6dd2f6ebd
MD5 aebbdcc85349557edac1621d4de37daa
BLAKE2b-256 3707df1d54801e56fc2645230bb70df2bd94c3c9893d0235597565670fb5daf6

See more details on using hashes here.

File details

Details for the file haystack_experimental-0.0.2.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for haystack_experimental-0.0.2.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fb642f1475b74a9cb1f1c07467fef5cecee117c6f9bd5819ece5c53d7f2535d
MD5 c92c5fd4b0d3b0849fabb5e3d16af74e
BLAKE2b-256 e76d2d7b3f7bdcf58ca9937039a4bf9451af0a9f19845dea9a8d31db5c86f2bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page