NAME

WebService::Chroma::Collection - chromadb collection

VERSION

Version 0.06

SYNOPSIS

	use WebService::Chroma::Collection;

	my $collection = WebService::Chroma::Collection->new(
		ua => WebService::Chroma::UA->new(...),
		tenant => '...',
		db => '...',
		id => '...',
		name => '...',
	);

        $collection->add(
                documents => [
                        'a blue scarf, a red hat, a woolly jumper, black gloves',
                        'a pink scarf, a blue hat, a woolly jumper, green gloves'
                ],
                ids => [
                        "1",
                        "2"
                ]
        );

        $collection->query(
                query_texts => [
                        'a pink scarf, a blue hat, green gloves'
                ],
                n_results => 1
        );

Methods

add

Add items to the collection.

$collection->add(
	documents => [
		'a blue scarf, a red hat, a woolly jumper, black gloves',
		'a pink scarf, a blue hat, a woolly jumper, green gloves'
	],
	ids => [
		"1",
		"2"
	]
);

upsert

Update or insert items into the collection.

$collection->upsert(
	documents => [
		'a blue scarf, a red hat, a woolly jumper, black gloves',
		'a pink scarf, a blue hat, a woolly jumper, green gloves'
	],
	ids => [
		"1",
		"2"
	]
);

update

Update items in the collection.

$collection->update(
	documents => [
		'a blue scarf, a red hat, a woolly jumper, black gloves',
		'a pink scarf, a blue hat, a woolly jumper, green gloves'
	],
	ids => [
		"1",
		"2"
	]
);

get

Retrieve items from the collection.

$collection->get(
	ids => [
		"1",
		"2"
	]
);

query

Retrieve items from the collection by query.

	 $collection->query(
                query_texts => [
                        'a pink scarf, a blue hat, green gloves'
                ],
                n_results => 1
        );

delete

Delete items from the collection.

$collection->delete(
	ids => [
		"1",
		"2"
	]
);

count

Returns the count for total number of items in the collection.

$collection->count();

AUTHOR

LNATION, <email at lnation.org>

BUGS

Please report any bugs or feature requests to bug-webservice-chroma at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Chroma. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc WebService::Chroma

You can also look for information at: