Public Models
OpenAI API models
This module contains the models for the OpenAI API.
The models are used to validate the data sent to and received from the OpenAI API.
The models are based on the OpenAI API documentation and use Pydantic to help serialise and deserialise the JSON.
OpenAIFunction
¶
Bases: BaseModel
OpenAI function
This class represents an OpenAI function.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the function |
description |
str
|
The description of the function, used by OpenAI to decide whether to use the function |
parameters |
OpenAIParameters
|
The parameters of the function |
Source code in src/simple_openai/models/open_ai_models.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
OpenAIParameter
¶
Bases: BaseModel
OpenAI parameter
This class represents an OpenAI parameter.
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
The type of the parameter |
description |
str
|
The description of the parameter, used by OpenAI to decide whether to use the parameter |
Source code in src/simple_openai/models/open_ai_models.py
13 14 15 16 17 18 19 20 21 22 23 24 |
|
OpenAIParameters
¶
Bases: BaseModel
OpenAI parameters
This class represents a list of OpenAI parameters.
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
The type of the parameters |
properties |
dict[str, OpenAIParameter]
|
The parameters |
required |
list[str]
|
The required parameters. Defaults to []. |
Source code in src/simple_openai/models/open_ai_models.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|