Skip to content

v4.0.6

Latest

Choose a tag to compare

@Maplemx Maplemx released this 10 Nov 12:03
· 28 commits to main since this release

Features

ChromaDB Integrations

You can use Agently ChromaDB Integrations to simplify the use case of ChromaDB

from agently import Agently
from agently.integrations.chromadb import ChromaData, ChromaEmbeddingFunction
from chromadb import Client as ChromaDBClient

embedding = Agently.create_agent()
embedding.set_settings(
    "OpenAICompatible",
    {
        "model": "qwen3-embedding:0.6b",
        "base_url": "http://127.0.0.1:11434/v1/",
        "auth": "nothing",
        "model_type": "embeddings",
    },
).set_settings("debug", False)

embedding_function = ChromaEmbeddingFunction(agent=embedding)

chroma_data = ChromaData(
    [
        {
            "document": "Book about Dogs",
            "metadata": {"book_name": "🐶"},
        },
        {
            "document": "Book about cars",
            "metadata": {"book_name": "🚗"},
        },
        {
            "document": "Book about vehicles",
            "metadata": {"book_name": "🚘"},
        },
        {
            "document": "Book about birds",
            "metadata": {"book_name": "🐦‍⬛"},
        },
    ],
)

chromadb = ChromaDBClient()
collection = chromadb.create_collection(
    name="test",
    get_or_create=True,
    metadata={
        "hnsw:space": "cosine",
    },
    configuration={
        "embedding_function": embedding_function,
    },
)

collection.add(**chroma_data.get_kwargs())
print("[ADD]:\n", chroma_data.get_original_data())

result = collection.query(query_texts=["Book about traffic"])
print(result)

Updates

TriggerFlow

  1. .when() support 'and', 'or' and 'simple_or' mode. [Example Code]
  2. Developers can use .save_blue_print() to export blue print data from trigger flow instance or from blue print instance and use .load_blue_print() to import blue print data into other trigger flow instance or blue print instance. [Example Code]

Agent Request

Better Prompt DX

  1. [Prompt]: New prompt slots options to allow developers to customize single request / agent request options.
  2. [Prompt]: New prompt slots examples to help developers provide one-shot / few-shots examples.
  3. [Prompt]: Update agent.prompt to allow developers export prompt text or messages only. [Example Code]
  4. [Prompt]: New settings prompt.prompt_title_mapping to help developers to customize title of different prompt slots. [Example Code]

Configure Prompt Update

  1. [Configure Prompt]: Support the expression of Agently output format. [Example Code]

Request Settings Updates to Support Local Deployed Model Service

  1. [Request Settings]: Support customized authorization headers [Example Code]
  2. [Request Settings]: Developers can use full_url to provide full model request URL in case that sometimes the model URL does not follow the rule of OpenAI base URL.
  3. [Request Settings]: Developers can use api_key in request settings now, it works all the same as auth.

Agent Response

  1. [Instant Mode]: StreamingData add attribute full_data which contains current completed streaming data.
  2. [Result]: Former .get_result() method is renamed as .get_data() which will return parsed data. New .get_result() method will return AgentlyResponseResult instance which contains more attributes to help developers to collect information of result.
  3. [Response Generator Type]: New response generator type typed_delta (and now .get_generator() and .get_async_generator() will use argument type instead of argument content).
  4. [Response Event]: Add new response event tool_calls which can be consumed in generator type typed_delta and instant / streaming_parse. [Example Code]

Plugins

  1. [Agent Extension Core]: Update extension handler slots to request_prefixes, broadcast_prefixes, broadcast_suffixes and finally
  2. [Tools]: Built-in tool Search new support argument options to customize more options configures. [Example Code]

Utils

  1. [FunctionShifter]: New decorator @auto_options_func to help developers to create a function that will ignore undefined key arguments that passed by caller (useful when model try to pass undefined arguments to a tool function).