Skip to content

Commit

Permalink
simplify ollama host configuration
Browse files Browse the repository at this point in the history
the ollama python client handles setting host from environment variables
already so configuration in discollama is no longer necessary
  • Loading branch information
mxyng committed Aug 29, 2024
1 parent dd84eb4 commit 71fe17e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions discollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ def run(self, token):
def main():
parser = argparse.ArgumentParser()

parser.add_argument('--ollama-scheme', default=os.getenv('OLLAMA_SCHEME', 'http'), choices=['http', 'https'])
parser.add_argument('--ollama-host', default=os.getenv('OLLAMA_HOST', '127.0.0.1'), type=str)
parser.add_argument('--ollama-port', default=os.getenv('OLLAMA_PORT', 11434), type=int)
parser.add_argument('--ollama-model', default=os.getenv('OLLAMA_MODEL', 'llama2'), type=str)

parser.add_argument('--redis-host', default=os.getenv('REDIS_HOST', '127.0.0.1'), type=str)
Expand All @@ -175,7 +172,7 @@ def main():
intents.message_content = True

Discollama(
ollama.AsyncClient(host=f'{args.ollama_scheme}://{args.ollama_host}:{args.ollama_port}'),
ollama.AsyncClient(),
discord.Client(intents=intents),
redis.Redis(host=args.redis_host, port=args.redis_port, db=0, decode_responses=True),
model=args.ollama_model,
Expand Down

0 comments on commit 71fe17e

Please sign in to comment.