Fix some of the commands.
This commit is contained in:
parent
75a123eb72
commit
5d1bb1f9e4
@ -68,6 +68,7 @@ class OpenAI(AI):
|
|||||||
self.ID = config.ID
|
self.ID = config.ID
|
||||||
self.name = config.name
|
self.name = config.name
|
||||||
self.config = config
|
self.config = config
|
||||||
|
openai.api_key = self.config.api_key
|
||||||
|
|
||||||
def request(self,
|
def request(self,
|
||||||
question: Message,
|
question: Message,
|
||||||
@ -80,7 +81,6 @@ class OpenAI(AI):
|
|||||||
nr. of messages in the 'AIResponse'.
|
nr. of messages in the 'AIResponse'.
|
||||||
"""
|
"""
|
||||||
self.encoding = tiktoken.encoding_for_model(self.config.model)
|
self.encoding = tiktoken.encoding_for_model(self.config.model)
|
||||||
openai.api_key = self.config.api_key
|
|
||||||
oai_chat, prompt_tokens = self.openai_chat(chat, self.config.system, question)
|
oai_chat, prompt_tokens = self.openai_chat(chat, self.config.system, question)
|
||||||
tokens: Tokens = Tokens(prompt_tokens, 0, prompt_tokens)
|
tokens: Tokens = Tokens(prompt_tokens, 0, prompt_tokens)
|
||||||
response = openai.ChatCompletion.create(
|
response = openai.ChatCompletion.create(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user