StreamlinedGPT is a Python library designed to simplify interactions with leading AI models. It provides a unified interface to seamlessly integrate and experiment with various models, removing the complexity of dealing with multiple APIs. The library also streamlines the process of granting AI access to tools, empowering users to leverage AI capabilities in a more dynamic and intuitive way, without the need to handle verbose syntax or repetitive boilerplate code.
Whether you're an individual innovator or an enterprise team, StreamlinedGPT is the perfect solution for experimenting with AI models, tooling workflows, and custom prompts. It's design prioritizes ease of use, aiding rapid prototyping and fostering creativity. By reducing development friction, it enables users to focus on building meaningful applications rather than wrestling with technical details.
The GitHub page can be accessed here https://github.com/XavierEgan/StreamlinedGPT
StreamlinedGPT is designed to simplify the syntax of existing solutions, like OpenAI's Python library, enabling rapid prototyping of tools, prompts, and experiments.
It addresses the lack of an easy, quick way to experiment with model tooling by eliminating boilerplate code and reducing complexity.
Below is a comparison of StreamlinedGPT and OpenAI's library.
StreamlinedGPT | Equivalent code with Openai |
---|---|
|
|
It currently only has OpenAI's models. However adding more models is extremely easy due to the structure of the project.
It is more limited compared to OpenAI's API. It lacks 4o's real time capabilities, structured outputs and streaming. However, this library is not intended to be used in a final product. Its intention is to be a tool for fast prototyping, trading off functionality for quick development.
The below code gives a simple example of how the library can be used
import StreamlinedGPT chatbot = StreamlinedGPT.Assistant( StreamlinedGPT.Openai_Text_Adaptor() ) chatbot.chatloop()
The Assistant
class takes in an Adaptor
. In this example the Openai_Text_Adaptor
was used. Currently the library only has an openai adaptor, however this will be expanded in the future.
Tool use is quite simple with StreamlinedGPT. A tool is a python function that the ai model can call. Below is an example
import StreamlinedGPT chatbot = StreamlinedGPT.Assistant( StreamlinedGPT.Openai_Text_Adaptor() ) def print_to_console(s): print(s) chatbot.add_tool( tool=StreamlinedGPT.Tool( function=print_to_console, name="print_to_console", description="prints something to the console", arguments=[ StreamlinedGPT.Argument( name="s", type="string", description="the string to print" ) ] ) ) chatbot.chatloop()
A tool is defined by making an instance of the Tool
class, and passing it into the add_tool
method of an Assistant
.
Argument
A class that represents an argument for a tool.
Argument | Type | Description |
---|---|---|
name | str | The name of the argument |
type | Literal["array", "string", "number", "boolean"] | The data type of the argument |
description | str | The description of the argument that is given to the model |
is_required | bool | Indicates whether the argument is required. Defaults to True |
list_type | str | The type of data the array should contain if the argument is an array. Defaults to "string" |
Assistant
A class that provides methods for having chat-like conversations with AI models.
Argument | Type | Description |
---|---|---|
adaptor | Text_Adaptor | The text adaptor used to communicate with the AI model |
send_message
Argument | Type | Description |
---|---|---|
message | str | The message to send to the model |
model | str | None | The LLM model to use. If None , the default model is used |
tool_choice | Literal["none", "auto", "required"] | Controls the model's tool use behavior. Defaults to "auto" |
send_message_without_history
Argument | Type | Description |
---|---|---|
message | str | The message to send to the model |
model | str | None | The LLM model to use. If None , the default model is used |
tool_choice | Literal["none", "auto", "required"] | Controls the model's tool use behavior. Defaults to "auto" |
add_tool
Argument | Type | Description |
---|---|---|
tool | Tool | The tool to add to the assistant |
chatloop
Starts an interactive chat loop in the console.
Tool
A class that represents a tool that can be used by the AI model.
Argument | Type | Description |
---|---|---|
function | callable | The function to be executed when the tool is called |
name | str | The name of the tool |
description | str | The description of the tool that is given to the model |
arguments | list[Argument] | A list of arguments that the tool function accepts |
There are no models linked
There are no models linked
There are no datasets linked
There are no datasets linked