Skip to main content

call-center

from call_center import Agent

user = "pmeier"
agent = Agent(system_prompt=f"The current user is {user}")


@agent.register
def get_products(user: str):
    """Get the available products for the user

    :param user: User to get products for.
    """
    return [f"Product{idx}" for idx in {"pmeier": [3, 5, 7, 14]}.get(user, [])]


print(agent.answer("What products are available for me?"))
print(get_products(user))
The available products for you are: Product3, Product5, Product7, and Product14.
['Product3', 'Product5', 'Product7', 'Product14']
@agent.register
def rank_products(products: list[str]):
    """Rank products by revenue.

    :param products: List of products to rank.
    """
    return sorted(products)


async def answer(prompt):
    async for chunk in agent.aanswer_stream(prompt):
        print(chunk, end="")
    print()


import asyncio

asyncio.run(answer("What are the top three products?"))
print(rank_products(get_products(user))[:3])
The top three products are:
1. Product14
2. Product3
3. Product5
['Product14', 'Product3', 'Product5']

Metadata

Release files for call-center 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for call-center 0.1.0
File Size Uploaded
call-center-0.1.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for call-center 0.1.0
File Interpreter ABI Platform
call_center-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / call-center-0.1.0.tar.gz

Download URL call-center-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
395bc82ac5483b4dc4d0d48b370408633bf0a6bdc706dcd152e15c5f8d3a95b2
BLAKE2b-256 checksum
How to use checksums
8079a8a336a1c3573fc28ecb6e905ecc6acb16cf59e73bbe9c47b7fc4874a8c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / call_center-0.1.0-py3-none-any.whl

Download URL call_center-0.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7eb7b058a5d99a2bf592c23a7bce08f2427483b803e17fd5ce504503e308767
BLAKE2b-256 checksum
How to use checksums
c8df84bbe4b805cfc247f4362251400282a0fe38eefe6c115640c813b15cc25b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page