Spaces:
Running
Running
File size: 1,016 Bytes
b5deaf1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
"""Module for OpenAI model and embeddings."""
from langchain_openai import AzureChatOpenAI, AzureOpenAIEmbeddings
class GPTModel(AzureChatOpenAI):
"""
GPTModel class that extends AzureChatOpenAI.
This class initializes a GPT model with specific deployment settings and a callback function.
Attributes:
callback (function): The callback function to be used with the model.
Methods:
__init__(callback):
Initializes the GPTModel with the specified callback function.
"""
def __init__(self):
super().__init__(
deployment_name="gpt-4o",
streaming=True, temperature=0)
class GPTEmbeddings(AzureOpenAIEmbeddings):
"""
GPTEmbeddings class that extends AzureOpenAIEmbeddings.
This class is designed to handle embeddings using GPT model provided by Azure OpenAI services.
Attributes:
Inherits all attributes from AzureOpenAIEmbeddings.
Methods:
Inherits all methods from AzureOpenAIEmbeddings.
"""
|