Skip to content

Commit

Permalink
TypedDict isn't compatible with Dict, but is with Mapping
Browse files Browse the repository at this point in the history
Using Mapping allows us to give MessageDict object and such directly,
without casting them as Dict.

Related Mypy issue: python/mypy#4976
  • Loading branch information
ramnes committed Jul 26, 2023
1 parent ac4e23b commit 300d786
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chainlit/client/cloud.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import uuid
from typing import Any, Dict, Optional, cast
from typing import Any, Dict, Mapping, Optional, cast

import aiohttp
from python_graphql_client import GraphqlClient
Expand Down Expand Up @@ -44,7 +44,7 @@ def check_for_errors(self, response: Dict[str, Any], raise_error: bool = False):
return False

async def mutation(
self, mutation: str, variables: Dict[str, Any] = {}
self, mutation: str, variables: Mapping[str, Any] = {}
) -> Dict[str, Any]:
"""
Execute a GraphQL mutation.
Expand Down

0 comments on commit 300d786

Please sign in to comment.