Open up the ollama command

This commit is contained in:
Nexus 2023-11-11 19:24:49 +00:00
parent f792905c03
commit 13ed2c5c17
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -1834,8 +1834,7 @@ class OtherCog(commands.Cog):
@commands.command( @commands.command(
usage="[model:<name:tag>] [server:<ip[:port]>] <query>" usage="[model:<name:tag>] [server:<ip[:port]>] <query>"
) )
@commands.is_owner() @commands.max_concurrency(1, commands.BucketType.user, wait=True)
@commands.max_concurrency(1, wait=True)
async def ollama(self, ctx: commands.Context, *, query: str): async def ollama(self, ctx: commands.Context, *, query: str):
""":3""" """:3"""
if query.startswith("model:"): if query.startswith("model:"):
@ -1848,6 +1847,10 @@ class OtherCog(commands.Cog):
else: else:
model = "orca-mini" model = "orca-mini"
if not await self.bot.is_owner(ctx.author):
if not model.startswith("orca-mini"):
return await ctx.reply(":x: You can only use `orca-mini` models.")
if query.startswith("server:"): if query.startswith("server:"):
host, query = query.split(" ", 1) host, query = query.split(" ", 1)
host = host[7:] host = host[7:]