mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🎨 chore: run black to format the code
This commit is contained in:
@@ -34,7 +34,8 @@ def createPrompt(
|
||||
sysprompt.replace("[server-name]", guildName)
|
||||
.replace("[channel-name]", channelName)
|
||||
.replace(
|
||||
"[date-and-time]", datetime.datetime.utcnow().strftime("%d/%m/%Y %H:%M:%S")
|
||||
"[date-and-time]",
|
||||
datetime.datetime.utcnow().strftime("%d/%m/%Y %H:%M:%S"),
|
||||
)
|
||||
)
|
||||
prompt[0]["content"] = sysprompt
|
||||
@@ -44,7 +45,8 @@ def createPrompt(
|
||||
.replace("[server-name]", guildName)
|
||||
.replace("[channel-name]", channelName)
|
||||
.replace(
|
||||
"[date-and-time]", datetime.datetime.utcnow().strftime("%d/%m/%Y %H:%M:%S")
|
||||
"[date-and-time]",
|
||||
datetime.datetime.utcnow().strftime("%d/%m/%Y %H:%M:%S"),
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -7,6 +7,7 @@ anthropic = AsyncAnthropic(
|
||||
api_key=os.getenv("ANTHROPIC_KEY"),
|
||||
)
|
||||
|
||||
|
||||
async def claude(messages):
|
||||
# messages are a dict {} with content and roler.
|
||||
prompt = ""
|
||||
@@ -20,7 +21,12 @@ async def claude(messages):
|
||||
elif message["role"] == "function":
|
||||
...
|
||||
prompt += AI_PROMPT
|
||||
completion = await anthropic.completions.create(stop_sequences=["\n\nHuman (", "\n\nSYSTEM: "], model="claude-2", max_tokens_to_sample=512, prompt=prompt)
|
||||
completion = await anthropic.completions.create(
|
||||
stop_sequences=["\n\nHuman (", "\n\nSYSTEM: "],
|
||||
model="claude-2",
|
||||
max_tokens_to_sample=512,
|
||||
prompt=prompt,
|
||||
)
|
||||
return {
|
||||
"name": "send_message",
|
||||
"arguments": {"message": completion.completion},
|
||||
|
||||
@@ -5,6 +5,7 @@ from src.chatUtils.requesters.llama import llama
|
||||
from src.chatUtils.requesters.llama2 import llama2
|
||||
from src.chatUtils.requesters.claude import claude
|
||||
|
||||
|
||||
class ModelNotFound(Exception):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user