semvec/pypi-packages huggingface dataset:
pytypingchat 0.0.1
A python style implementation of Typechat.
Requires Python: >=3.10

# typingchat

A python style implementation of Typechat 

# Useage
```
pip3 install pytypingchat
```

local install
```
pip3 install .
```

## demo
Custom dataclass 
```
from typingchat.core import TypeChat,OpenAIChat
from pydantic import BaseModel,Field
from typing import Literal

class Customer(BaseModel):
    name: str = Field(description="Specify the customer's name")

class CoffeeDrink(BaseModel):
    type: Literal["CoffeeDrink"] = Field(default="CoffeeDrink", description="Specify the type of coffee drink")
    name: Literal["cappuccino", "flat white", "latte", "latte macchiato", "mocha", "chai latte"] = Field(None,                                                                                             description="Specify the name of the coffee drink")
    count: int = Field(1, description="Specify the selected drink quantity")

    def add_sugar(self, customer: Customer):
        """
        add some sugar to coffee

        Returns:

        """
        return "add sugar success"
```

```
OPENAI_API_KEY = "sk-xxx"
OPENAI_MODEL = "gpt-3.5-turbo-0125"

chat = OpenAIChat(api_key=OPENAI_API_KEY,model=OPENAI_MODEL)
typechat = TypeChat(chat=chat)
coffee: CoffeeDrink = typechat.translate( #type: ignore
    message="I want a mocha.",
    obj=CoffeeDrink
)

coffee.model_dump() # {'type': 'CoffeeDrink', 'name': 'mocha', 'count': 1})

```
output
```
{'type': 'CoffeeDrink', 'name': 'mocha', 'count': 1})
```
use as function call
```
chat = OpenAIChat(api_key=OPENAI_API_KEY, model=OPENAI_MODEL)
typechat = TypeChat(chat=chat)
product = typechat.translate(
    message="I want a flat white",
    obj=CoffeeDrink
)
filter = lambda name: True if name in [product.add_sugar.__name__] else False
reply_messsage = typechat.operate(product, message="Add a little sugar to Tom's coffee", func_filter=filter,extra_dataclass=[Customer])

reply_message.content # The sugar has been successfully added to Tom's coffee.
```


# References
1. https://github.com/microsoft/TypeChat
typingchat 0.0.1
A python style implementation of Typechat.
Requires Python: >=3.10

# typingchat

A python style implementation of Typechat 

# Useage
```
pip3 install typingchat
```

## demo
Custom dataclass 
```
from typingchat.core import TypeChat,OpenAIChat
from pydantic import BaseModel,Field
from typing import Literal

class Customer(BaseModel):
    name: str = Field(description="Specify the customer's name")

class CoffeeDrink(BaseModel):
    type: Literal["CoffeeDrink"] = Field(default="CoffeeDrink", description="Specify the type of coffee drink")
    name: Literal["cappuccino", "flat white", "latte", "latte macchiato", "mocha", "chai latte"] = Field(None,                                                                                             description="Specify the name of the coffee drink")
    count: int = Field(1, description="Specify the selected drink quantity")

    def add_sugar(self, customer: Customer):
        """
        add some sugar to coffee

        Returns:

        """
        return "add sugar success"
```

```
OPENAI_API_KEY = "sk-xxx"
OPENAI_MODEL = "gpt-3.5-turbo-0125"

chat = OpenAIChat(api_key=OPENAI_API_KEY,model=OPENAI_MODEL)
typechat = TypeChat(chat=chat)
coffee: CoffeeDrink = typechat.translate( #type: ignore
    message="I want a mocha.",
    obj=CoffeeDrink
)

coffee.model_dump() # {'type': 'CoffeeDrink', 'name': 'mocha', 'count': 1})

```

output
```
{'type': 'CoffeeDrink', 'name': 'mocha', 'count': 1})
```

use as function call

```
chat = OpenAIChat(api_key=OPENAI_API_KEY, model=OPENAI_MODEL)
typechat = TypeChat(chat=chat)
product = typechat.translate(
    message="I want a flat white",
    obj=CoffeeDrink
)
filter = lambda name: True if name in [product.add_sugar.__name__] else False
reply_messsage = typechat.operate(product, message="Add a little sugar to Tom's coffee", func_filter=filter,extra_dataclass=[Customer])

reply_message.content # The sugar has been successfully added to Tom's coffee.
```


# References
1. https://github.com/microsoft/TypeChat
multiconnection 2.34.22
Python MultiHTTP for Humans.
Requires Python: >=3.6

# MultiConnect

**MultiConnect** is a simple, yet elegant, HTTP library for sending multiple asyncronous requests, built on the classic requests library.

```python
>>> import multiconnect
>>> r = multiconnect.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'), amount=100)
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"authenticated": true, ...'
>>> r.json()
{'authenticated': True, ...}
```

MultiConnect allows you to send thousands of HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your `PUT` & `POST` data — but nowadays, just use the `json` method!

[![Downloads](https://pepy.tech/badge/requests/month)](https://pepy.tech/project/requests)
[![Supported Versions](https://img.shields.io/pypi/pyversions/requests.svg)](https://pypi.org/project/requests)
[![Contributors](https://img.shields.io/github/contributors/psf/requests.svg)](https://github.com/psf/requests/graphs/contributors)

## Installing MultiConnect and Supported Versions

MultiConnect is available on PyPI:

```console
$ python -m pip install multiconnect
```

MultiConnect officially supports Python 3.7+.

## Supported Features & Best–Practices

MultiConnect is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.

- Keep-Alive & Connection Pooling
- International Domains and URLs
- Sessions with Cookie Persistence
- Browser-style TLS/SSL Verification
- Basic & Digest Authentication
- Familiar `dict`–like Cookies
- Automatic Content Decompression and Decoding
- Multi-part File Uploads
- SOCKS Proxy Support
- Connection Timeouts
- Streaming Downloads
- Automatic honoring of `.netrc`
- Chunked HTTP Requests

## API Reference and User Guide available on [Read the Docs](https://requests.readthedocs.io)

[![Read the Docs](https://raw.githubusercontent.com/psf/requests/main/ext/ss.png)](https://requests.readthedocs.io)

## Cloning the repository

When cloning the Requests repository, you may need to add the `-c
fetch.fsck.badTimezone=ignore` flag to avoid an error about a bad commit (see
[this issue](https://github.com/psf/requests/issues/2690) for more background):

```shell
git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git
```

You can also apply this setting to your global Git config:

```shell
git config --global fetch.fsck.badTimezone ignore
```

---

[![Kenneth Reitz](https://raw.githubusercontent.com/psf/requests/main/ext/kr.png)](https://kennethreitz.org) [![Python Software Foundation](https://raw.githubusercontent.com/psf/requests/main/ext/psf.png)](https://www.python.org/psf)