griptape icon indicating copy to clipboard operation
griptape copied to clipboard

if `client` is passed as a parameter, other fields should be optional

Open vachillo opened this issue 8 months ago • 0 comments

Describe the bug if a client parameter is passed in any class that has one, the other fields that are parameters solely for the internal client instantiation should not be required.

To Reproduce Steps to reproduce the behavior:

RedisConversationMemoryDriver(
            client=Redis.from_url(f"rediss://{os.environ['REDIS_USERNAME']}:{os.environ['REDIS_PASSWORD']}@{os.environ['REDIS_HOST']}:{os.environ['REDIS_PORT']}"),
            index="index",
            # if host, port, or password are not defined, the driver will fail init, even though the client is defined above
            host=os.environ["REDIS_HOST"],
            port=os.environ["REDIS_PORT"],
            password=os.environ['REDIS_PASSWORD'],
            conversation_id=conversation_id,
        ),

Expected behavior if client is passed in, other fields that are used only for building the client internally should not be required.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 0.5.1]

Additional context Add any other context about the problem here.

vachillo avatar Jun 03 '24 16:06 vachillo