prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Support CASESENSITIVE tag in Tag Field 
  link: https://oss.redis.com/redisearch/Commands/#ftcreate
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `redis/commands/search/field.py`
  Content:
  ```
  1 from typing import List
  2 
  3 from redis import DataError
  4 
  5 
  6 class Field:
  7 
  8     NUMERIC = "NUMERIC"
  9     TEXT = "TEXT"
  10     WEIGHT = "WEIGHT"
  11     GEO = "GEO"
  12     TAG = "TAG"
  13     VECTOR = "VECTOR"
  14     SORTABLE = "SORTABLE"
  15     NOINDEX = "NOINDEX"
  16     AS = "AS"
  17 
  18     def __init__(
  19         self,
  20         name: str,
  21         args: List[str] = None,
  22         sortable: bool = False,
  23         no_index: bool = False,
  24         as_name: str = None,
  25     ):
  26         if args is None:
  27             args = []
  28         self.name = name
  29         self.args = args
  30         self.args_suffix = list()
  31         self.as_name = as_name
  32 
  33         if sortable:
  34             self.args_suffix.append(Field.SORTABLE)
  35         if no_index:
  36             self.args_suffix.append(Field.NOINDEX)
  37 
  38         if no_index and not sortable:
  39             raise ValueError("Non-Sortable non-Indexable fields are ignored")
  40 
  41     def append_arg(self, value):
  42         self.args.append(value)
  43 
  44     def redis_args(self):
  45         args = [self.name]
  46         if self.as_name:
  47             args += [self.AS, self.as_name]
  48         args += self.args
  49         args += self.args_suffix
  50         return args
  51 
  52 
  53 class TextField(Field):
  54     """
  55     TextField is used to define a text field in a schema definition
  56     """
  57 
  58     NOSTEM = "NOSTEM"
  59     PHONETIC = "PHONETIC"
  60 
  61     def __init__(
  62         self,
  63         name: str,
  64         weight: float = 1.0,
  65         no_stem: bool = False,
  66         phonetic_matcher: str = None,
  67         **kwargs,
  68     ):
  69         Field.__init__(self, name, args=[Field.TEXT, Field.WEIGHT, weight], **kwargs)
  70 
  71         if no_stem:
  72             Field.append_arg(self, self.NOSTEM)
  73         if phonetic_matcher and phonetic_matcher in [
  74             "dm:en",
  75             "dm:fr",
  76             "dm:pt",
  77             "dm:es",
  78         ]:
  79             Field.append_arg(self, self.PHONETIC)
  80             Field.append_arg(self, phonetic_matcher)
  81 
  82 
  83 class NumericField(Field):
  84     """
  85     NumericField is used to define a numeric field in a schema definition
  86     """
  87 
  88     def __init__(self, name: str, **kwargs):
  89         Field.__init__(self, name, args=[Field.NUMERIC], **kwargs)
  90 
  91 
  92 class GeoField(Field):
  93     """
  94     GeoField is used to define a geo-indexing field in a schema definition
  95     """
  96 
  97     def __init__(self, name: str, **kwargs):
  98         Field.__init__(self, name, args=[Field.GEO], **kwargs)
  99 
  100 
  101 class TagField(Field):
  102     """
  103     TagField is a tag-indexing field with simpler compression and tokenization.
  104     See http://redisearch.io/Tags/
  105     """
  106 
  107     SEPARATOR = "SEPARATOR"
  108 
  109     def __init__(self, name: str, separator: str = ",", **kwargs):
  110         Field.__init__(
  111             self, name, args=[Field.TAG, self.SEPARATOR, separator], **kwargs
  112         )
  113 
  114 
  115 class VectorField(Field):
  116     """
  117     Allows vector similarity queries against the value in this attribute.
  118     See https://oss.redis.com/redisearch/Vectors/#vector_fields.
  119     """
  120 
  121     def __init__(self, name: str, algorithm: str, attributes: dict, **kwargs):
  122         """
  123         Create Vector Field. Notice that Vector cannot have sortable or no_index tag,
  124         although it's also a Field.
  125 
  126         ``name`` is the name of the field.
  127 
  128         ``algorithm`` can be "FLAT" or "HNSW".
  129 
  130         ``attributes`` each algorithm can have specific attributes. Some of them
  131         are mandatory and some of them are optional. See
  132         https://oss.redis.com/redisearch/master/Vectors/#specific_creation_attributes_per_algorithm
  133         for more information.
  134         """
  135         sort = kwargs.get("sortable", False)
  136         noindex = kwargs.get("no_index", False)
  137 
  138         if sort or noindex:
  139             raise DataError("Cannot set 'sortable' or 'no_index' in Vector fields.")
  140 
  141         if algorithm.upper() not in ["FLAT", "HNSW"]:
  142             raise DataError(
  143                 "Realtime vector indexing supporting 2 Indexing Methods:"
  144                 "'FLAT' and 'HNSW'."
  145             )
  146 
  147         attr_li = []
  148 
  149         for key, value in attributes.items():
  150             attr_li.extend([key, value])
  151 
  152         Field.__init__(
  153             self,
  154             name,
  155             args=[Field.VECTOR, algorithm, len(attr_li), *attr_li],
  156             **kwargs,
  157         )
  158
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/redis/commands/search/field.py b/redis/commands/search/field.py
  --- a/redis/commands/search/field.py
  +++ b/redis/commands/search/field.py
  @@ -105,11 +105,20 @@
       """
   
       SEPARATOR = "SEPARATOR"
  +    CASESENSITIVE = "CASESENSITIVE"
   
  -    def __init__(self, name: str, separator: str = ",", **kwargs):
  -        Field.__init__(
  -            self, name, args=[Field.TAG, self.SEPARATOR, separator], **kwargs
  -        )
  +    def __init__(
  +        self,
  +        name: str,
  +        separator: str = ",",
  +        case_sensitive: bool = False,
  +        **kwargs,
  +    ):
  +        args = [Field.TAG, self.SEPARATOR, separator]
  +        if case_sensitive:
  +            args.append(self.CASESENSITIVE)
  +
  +        Field.__init__(self, name, args=args, **kwargs)
   
   
   class VectorField(Field):
  
verification_info: {"golden_diff": "diff --git a/redis/commands/search/field.py b/redis/commands/search/field.py\n--- a/redis/commands/search/field.py\n+++ b/redis/commands/search/field.py\n@@ -105,11 +105,20 @@\n     \"\"\"\n \n     SEPARATOR = \"SEPARATOR\"\n+    CASESENSITIVE = \"CASESENSITIVE\"\n \n-    def __init__(self, name: str, separator: str = \",\", **kwargs):\n-        Field.__init__(\n-            self, name, args=[Field.TAG, self.SEPARATOR, separator], **kwargs\n-        )\n+    def __init__(\n+        self,\n+        name: str,\n+        separator: str = \",\",\n+        case_sensitive: bool = False,\n+        **kwargs,\n+    ):\n+        args = [Field.TAG, self.SEPARATOR, separator]\n+        if case_sensitive:\n+            args.append(self.CASESENSITIVE)\n+\n+        Field.__init__(self, name, args=args, **kwargs)\n \n \n class VectorField(Field):\n", "issue": "Support CASESENSITIVE tag in Tag Field \nlink: https://oss.redis.com/redisearch/Commands/#ftcreate\n", "before_files": [{"content": "from typing import List\n\nfrom redis import DataError\n\n\nclass Field:\n\n    NUMERIC = \"NUMERIC\"\n    TEXT = \"TEXT\"\n    WEIGHT = \"WEIGHT\"\n    GEO = \"GEO\"\n    TAG = \"TAG\"\n    VECTOR = \"VECTOR\"\n    SORTABLE = \"SORTABLE\"\n    NOINDEX = \"NOINDEX\"\n    AS = \"AS\"\n\n    def __init__(\n        self,\n        name: str,\n        args: List[str] = None,\n        sortable: bool = False,\n        no_index: bool = False,\n        as_name: str = None,\n    ):\n        if args is None:\n            args = []\n        self.name = name\n        self.args = args\n        self.args_suffix = list()\n        self.as_name = as_name\n\n        if sortable:\n            self.args_suffix.append(Field.SORTABLE)\n        if no_index:\n            self.args_suffix.append(Field.NOINDEX)\n\n        if no_index and not sortable:\n            raise ValueError(\"Non-Sortable non-Indexable fields are ignored\")\n\n    def append_arg(self, value):\n        self.args.append(value)\n\n    def redis_args(self):\n        args = [self.name]\n        if self.as_name:\n            args += [self.AS, self.as_name]\n        args += self.args\n        args += self.args_suffix\n        return args\n\n\nclass TextField(Field):\n    \"\"\"\n    TextField is used to define a text field in a schema definition\n    \"\"\"\n\n    NOSTEM = \"NOSTEM\"\n    PHONETIC = \"PHONETIC\"\n\n    def __init__(\n        self,\n        name: str,\n        weight: float = 1.0,\n        no_stem: bool = False,\n        phonetic_matcher: str = None,\n        **kwargs,\n    ):\n        Field.__init__(self, name, args=[Field.TEXT, Field.WEIGHT, weight], **kwargs)\n\n        if no_stem:\n            Field.append_arg(self, self.NOSTEM)\n        if phonetic_matcher and phonetic_matcher in [\n            \"dm:en\",\n            \"dm:fr\",\n            \"dm:pt\",\n            \"dm:es\",\n        ]:\n            Field.append_arg(self, self.PHONETIC)\n            Field.append_arg(self, phonetic_matcher)\n\n\nclass NumericField(Field):\n    \"\"\"\n    NumericField is used to define a numeric field in a schema definition\n    \"\"\"\n\n    def __init__(self, name: str, **kwargs):\n        Field.__init__(self, name, args=[Field.NUMERIC], **kwargs)\n\n\nclass GeoField(Field):\n    \"\"\"\n    GeoField is used to define a geo-indexing field in a schema definition\n    \"\"\"\n\n    def __init__(self, name: str, **kwargs):\n        Field.__init__(self, name, args=[Field.GEO], **kwargs)\n\n\nclass TagField(Field):\n    \"\"\"\n    TagField is a tag-indexing field with simpler compression and tokenization.\n    See http://redisearch.io/Tags/\n    \"\"\"\n\n    SEPARATOR = \"SEPARATOR\"\n\n    def __init__(self, name: str, separator: str = \",\", **kwargs):\n        Field.__init__(\n            self, name, args=[Field.TAG, self.SEPARATOR, separator], **kwargs\n        )\n\n\nclass VectorField(Field):\n    \"\"\"\n    Allows vector similarity queries against the value in this attribute.\n    See https://oss.redis.com/redisearch/Vectors/#vector_fields.\n    \"\"\"\n\n    def __init__(self, name: str, algorithm: str, attributes: dict, **kwargs):\n        \"\"\"\n        Create Vector Field. Notice that Vector cannot have sortable or no_index tag,\n        although it's also a Field.\n\n        ``name`` is the name of the field.\n\n        ``algorithm`` can be \"FLAT\" or \"HNSW\".\n\n        ``attributes`` each algorithm can have specific attributes. Some of them\n        are mandatory and some of them are optional. See\n        https://oss.redis.com/redisearch/master/Vectors/#specific_creation_attributes_per_algorithm\n        for more information.\n        \"\"\"\n        sort = kwargs.get(\"sortable\", False)\n        noindex = kwargs.get(\"no_index\", False)\n\n        if sort or noindex:\n            raise DataError(\"Cannot set 'sortable' or 'no_index' in Vector fields.\")\n\n        if algorithm.upper() not in [\"FLAT\", \"HNSW\"]:\n            raise DataError(\n                \"Realtime vector indexing supporting 2 Indexing Methods:\"\n                \"'FLAT' and 'HNSW'.\"\n            )\n\n        attr_li = []\n\n        for key, value in attributes.items():\n            attr_li.extend([key, value])\n\n        Field.__init__(\n            self,\n            name,\n            args=[Field.VECTOR, algorithm, len(attr_li), *attr_li],\n            **kwargs,\n        )\n", "path": "redis/commands/search/field.py"}], "after_files": [{"content": "from typing import List\n\nfrom redis import DataError\n\n\nclass Field:\n\n    NUMERIC = \"NUMERIC\"\n    TEXT = \"TEXT\"\n    WEIGHT = \"WEIGHT\"\n    GEO = \"GEO\"\n    TAG = \"TAG\"\n    VECTOR = \"VECTOR\"\n    SORTABLE = \"SORTABLE\"\n    NOINDEX = \"NOINDEX\"\n    AS = \"AS\"\n\n    def __init__(\n        self,\n        name: str,\n        args: List[str] = None,\n        sortable: bool = False,\n        no_index: bool = False,\n        as_name: str = None,\n    ):\n        if args is None:\n            args = []\n        self.name = name\n        self.args = args\n        self.args_suffix = list()\n        self.as_name = as_name\n\n        if sortable:\n            self.args_suffix.append(Field.SORTABLE)\n        if no_index:\n            self.args_suffix.append(Field.NOINDEX)\n\n        if no_index and not sortable:\n            raise ValueError(\"Non-Sortable non-Indexable fields are ignored\")\n\n    def append_arg(self, value):\n        self.args.append(value)\n\n    def redis_args(self):\n        args = [self.name]\n        if self.as_name:\n            args += [self.AS, self.as_name]\n        args += self.args\n        args += self.args_suffix\n        return args\n\n\nclass TextField(Field):\n    \"\"\"\n    TextField is used to define a text field in a schema definition\n    \"\"\"\n\n    NOSTEM = \"NOSTEM\"\n    PHONETIC = \"PHONETIC\"\n\n    def __init__(\n        self,\n        name: str,\n        weight: float = 1.0,\n        no_stem: bool = False,\n        phonetic_matcher: str = None,\n        **kwargs,\n    ):\n        Field.__init__(self, name, args=[Field.TEXT, Field.WEIGHT, weight], **kwargs)\n\n        if no_stem:\n            Field.append_arg(self, self.NOSTEM)\n        if phonetic_matcher and phonetic_matcher in [\n            \"dm:en\",\n            \"dm:fr\",\n            \"dm:pt\",\n            \"dm:es\",\n        ]:\n            Field.append_arg(self, self.PHONETIC)\n            Field.append_arg(self, phonetic_matcher)\n\n\nclass NumericField(Field):\n    \"\"\"\n    NumericField is used to define a numeric field in a schema definition\n    \"\"\"\n\n    def __init__(self, name: str, **kwargs):\n        Field.__init__(self, name, args=[Field.NUMERIC], **kwargs)\n\n\nclass GeoField(Field):\n    \"\"\"\n    GeoField is used to define a geo-indexing field in a schema definition\n    \"\"\"\n\n    def __init__(self, name: str, **kwargs):\n        Field.__init__(self, name, args=[Field.GEO], **kwargs)\n\n\nclass TagField(Field):\n    \"\"\"\n    TagField is a tag-indexing field with simpler compression and tokenization.\n    See http://redisearch.io/Tags/\n    \"\"\"\n\n    SEPARATOR = \"SEPARATOR\"\n    CASESENSITIVE = \"CASESENSITIVE\"\n\n    def __init__(\n        self,\n        name: str,\n        separator: str = \",\",\n        case_sensitive: bool = False,\n        **kwargs,\n    ):\n        args = [Field.TAG, self.SEPARATOR, separator]\n        if case_sensitive:\n            args.append(self.CASESENSITIVE)\n\n        Field.__init__(self, name, args=args, **kwargs)\n\n\nclass VectorField(Field):\n    \"\"\"\n    Allows vector similarity queries against the value in this attribute.\n    See https://oss.redis.com/redisearch/Vectors/#vector_fields.\n    \"\"\"\n\n    def __init__(self, name: str, algorithm: str, attributes: dict, **kwargs):\n        \"\"\"\n        Create Vector Field. Notice that Vector cannot have sortable or no_index tag,\n        although it's also a Field.\n\n        ``name`` is the name of the field.\n\n        ``algorithm`` can be \"FLAT\" or \"HNSW\".\n\n        ``attributes`` each algorithm can have specific attributes. Some of them\n        are mandatory and some of them are optional. See\n        https://oss.redis.com/redisearch/master/Vectors/#specific_creation_attributes_per_algorithm\n        for more information.\n        \"\"\"\n        sort = kwargs.get(\"sortable\", False)\n        noindex = kwargs.get(\"no_index\", False)\n\n        if sort or noindex:\n            raise DataError(\"Cannot set 'sortable' or 'no_index' in Vector fields.\")\n\n        if algorithm.upper() not in [\"FLAT\", \"HNSW\"]:\n            raise DataError(\n                \"Realtime vector indexing supporting 2 Indexing Methods:\"\n                \"'FLAT' and 'HNSW'.\"\n            )\n\n        attr_li = []\n\n        for key, value in attributes.items():\n            attr_li.extend([key, value])\n\n        Field.__init__(\n            self,\n            name,\n            args=[Field.VECTOR, algorithm, len(attr_li), *attr_li],\n            **kwargs,\n        )\n", "path": "redis/commands/search/field.py"}]}