Releases: minimaxir/simpleaichat
Releases · minimaxir/simpleaichat
v0.2.2: Misc fixes/improvements
- Allow
fd
to take in arbitrary parameters that could be used forField
(I have a cool project with this in mind!) - Use
argparse
for the CLI app #50 (TODO: removefire
dependency) - Pass
str
urls for buildingapi_url
#52 - Added an assert if using
title
in an input/output schema, since it's a reserved keyword that we're already stripping. Note that this currently only affects the top-level schema.
v0.2.1: Pydantic v2.0
This release updates simpleaichat to use Pydantic v2.0 and replace all depreciated functions therein. simpleaichat now requires pydantic>=2.0
. There should be no breaking changes from this migration, but there should be a notable speedboost from the clientside!
Other changes
- Internal Refactoring #19
- API key from
AIChat
constructor has priority overenv
variable, for consistency #22 ChatMessage
string returns a stringified dictionary instead of the text only. #29- A HTTP proxy can be specified by the
https_proxy
environment variable. This behavior will likely change in an upcoming release #34
v0.2.0: Schema input/output
This release supports schema input/output, courtesy of OpenAI's new function calling feature!
Schema
from pydantic import BaseModel, Field
ai = AIChat(
console=False,
save_messages=False, # with schema I/O, messages are never saved
model="gpt-3.5-turbo-0613",
params={"temperature": 0.0},
)
class get_event_metadata(BaseModel):
"""Event information"""
description: str = Field(description="Description of event")
city: str = Field(description="City where event occured")
year: int = Field(description="Year when event occured")
month: str = Field(description="Month when event occured")
# returns a dict, with keys ordered as in the schema
ai("First iPhone announcement", output_schema=get_event_metadata)
{'description': 'The first iPhone was announced by Apple Inc.',
'city': 'San Francisco',
'year': 2007,
'month': 'January'}
There's a lot you can do with it, and this implementation is just the beginning.
Notes:
- In all cases, no messages are saved when using schema to prevent unintended behavior. You will have to manage the intermediate output yourself for the time being, if you want to chain inputs.
- Input and Output schema works for normal generation, both sync and async.
- For streaming, only input schema will work, as streaming output structured data would not play nice.
- Neither is currently supported for working with tools; that still needs further testing.
Other changes:
v0.1.1
v0.1.0: Initial Public release!
version bump
v0.0.1: Initial testing release
Initial testing release (to reserve the name on PyPI and test on Colab)