prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Missing default value to logprobs in openai.types.chat.chat_completion.Choice
  ### Confirm this is an issue with the Python library and not an underlying OpenAI API
  
  - [X] This is an issue with the Python library
  
  ### Describe the bug
  
  #980 added token `logprobs` to chat completions of type `Optional[ChoiceLogprobs]` in [`openai.types.chat.chat_completion.Choice`](https://github.com/openai/openai-python/blob/3ad4e8bc9d89d7a81586bf598289ff62b0a339b9/src/openai/types/chat/chat_completion.py#L33) and [`openai.types.chat.chat_completion_chunk.Choice`](https://github.com/openai/openai-python/blob/3ad4e8bc9d89d7a81586bf598289ff62b0a339b9/src/openai/types/chat/chat_completion_chunk.py#L97). In the latter, the default value is set to `None`, while in the former it is not set. This causes backward compatibility problems with code written for versions prior to 1.5.0.
  
  
  
  ### To Reproduce
  
  Execution of the following code fails:
  
  ```python 
  from openai.types.chat.chat_completion import ChatCompletionMessage, Choice
  
  msg = ChatCompletionMessage(role="assistant", content="")
  
  Choice(
      index=0,
      finish_reason="stop",
      message=msg,
  )
  ```
  The output
  ```
  ----> 1 Choice(
        2     index=0,
        3     finish_reason="stop",
        4     message=msg,
        5 )
  
  File /.venv-3.10/lib/python3.10/site-packages/pydantic/main.py:164, in BaseModel.__init__(__pydantic_self__, **data)
      162 # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks
      163 __tracebackhide__ = True
  --> 164 __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
  
  ValidationError: 1 validation error for Choice
  logprobs
    Field required [type=missing, input_value={'index': 0, 'finish_reas...=None, tool_calls=None)}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.5/v/missing
  ```
  Setting `logprobs` to `None` fixes the problem.
  ```python 
  from openai.types.chat.chat_completion import ChatCompletionMessage, Choice
  
  msg = ChatCompletionMessage(role="assistant", content="")
  
  Choice(
      index=0,
      finish_reason="stop",
      message=msg,
      logprobs=None # added line
  )
  ```
  
  ### Code snippets
  
  ```Python
  see above
  ```
  
  
  ### OS
  
  Linux
  
  ### Python version
  
  Python 3.10.13
  
  ### Library version
  
  openai 1.6.0
  
  </issue>
  <code>
  [start of src/openai/types/chat/chat_completion.py]
  1 # File generated from our OpenAPI spec by Stainless.
  2 
  3 from typing import List, Optional
  4 from typing_extensions import Literal
  5 
  6 from ..._models import BaseModel
  7 from ..completion_usage import CompletionUsage
  8 from .chat_completion_message import ChatCompletionMessage
  9 from .chat_completion_token_logprob import ChatCompletionTokenLogprob
  10 
  11 __all__ = ["ChatCompletion", "Choice", "ChoiceLogprobs"]
  12 
  13 
  14 class ChoiceLogprobs(BaseModel):
  15     content: Optional[List[ChatCompletionTokenLogprob]]
  16     """A list of message content tokens with log probability information."""
  17 
  18 
  19 class Choice(BaseModel):
  20     finish_reason: Literal["stop", "length", "tool_calls", "content_filter", "function_call"]
  21     """The reason the model stopped generating tokens.
  22 
  23     This will be `stop` if the model hit a natural stop point or a provided stop
  24     sequence, `length` if the maximum number of tokens specified in the request was
  25     reached, `content_filter` if content was omitted due to a flag from our content
  26     filters, `tool_calls` if the model called a tool, or `function_call`
  27     (deprecated) if the model called a function.
  28     """
  29 
  30     index: int
  31     """The index of the choice in the list of choices."""
  32 
  33     logprobs: Optional[ChoiceLogprobs]
  34     """Log probability information for the choice."""
  35 
  36     message: ChatCompletionMessage
  37     """A chat completion message generated by the model."""
  38 
  39 
  40 class ChatCompletion(BaseModel):
  41     id: str
  42     """A unique identifier for the chat completion."""
  43 
  44     choices: List[Choice]
  45     """A list of chat completion choices.
  46 
  47     Can be more than one if `n` is greater than 1.
  48     """
  49 
  50     created: int
  51     """The Unix timestamp (in seconds) of when the chat completion was created."""
  52 
  53     model: str
  54     """The model used for the chat completion."""
  55 
  56     object: Literal["chat.completion"]
  57     """The object type, which is always `chat.completion`."""
  58 
  59     system_fingerprint: Optional[str] = None
  60     """This fingerprint represents the backend configuration that the model runs with.
  61 
  62     Can be used in conjunction with the `seed` request parameter to understand when
  63     backend changes have been made that might impact determinism.
  64     """
  65 
  66     usage: Optional[CompletionUsage] = None
  67     """Usage statistics for the completion request."""
  68
  [end of src/openai/types/chat/chat_completion.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/openai/types/chat/chat_completion.py b/src/openai/types/chat/chat_completion.py
  --- a/src/openai/types/chat/chat_completion.py
  +++ b/src/openai/types/chat/chat_completion.py
  @@ -30,7 +30,7 @@
       index: int
       """The index of the choice in the list of choices."""
   
  -    logprobs: Optional[ChoiceLogprobs]
  +    logprobs: Optional[ChoiceLogprobs] = None
       """Log probability information for the choice."""
   
       message: ChatCompletionMessage
  
verification_info: {"golden_diff": "diff --git a/src/openai/types/chat/chat_completion.py b/src/openai/types/chat/chat_completion.py\n--- a/src/openai/types/chat/chat_completion.py\n+++ b/src/openai/types/chat/chat_completion.py\n@@ -30,7 +30,7 @@\n     index: int\n     \"\"\"The index of the choice in the list of choices.\"\"\"\n \n-    logprobs: Optional[ChoiceLogprobs]\n+    logprobs: Optional[ChoiceLogprobs] = None\n     \"\"\"Log probability information for the choice.\"\"\"\n \n     message: ChatCompletionMessage\n", "issue": "Missing default value to logprobs in openai.types.chat.chat_completion.Choice\n### Confirm this is an issue with the Python library and not an underlying OpenAI API\r\n\r\n- [X] This is an issue with the Python library\r\n\r\n### Describe the bug\r\n\r\n#980 added token `logprobs` to chat completions of type `Optional[ChoiceLogprobs]` in [`openai.types.chat.chat_completion.Choice`](https://github.com/openai/openai-python/blob/3ad4e8bc9d89d7a81586bf598289ff62b0a339b9/src/openai/types/chat/chat_completion.py#L33) and [`openai.types.chat.chat_completion_chunk.Choice`](https://github.com/openai/openai-python/blob/3ad4e8bc9d89d7a81586bf598289ff62b0a339b9/src/openai/types/chat/chat_completion_chunk.py#L97). In the latter, the default value is set to `None`, while in the former it is not set. This causes backward compatibility problems with code written for versions prior to 1.5.0.\r\n\r\n\r\n\r\n### To Reproduce\r\n\r\nExecution of the following code fails:\r\n\r\n```python \r\nfrom openai.types.chat.chat_completion import ChatCompletionMessage, Choice\r\n\r\nmsg = ChatCompletionMessage(role=\"assistant\", content=\"\")\r\n\r\nChoice(\r\n    index=0,\r\n    finish_reason=\"stop\",\r\n    message=msg,\r\n)\r\n```\r\nThe output\r\n```\r\n----> 1 Choice(\r\n      2     index=0,\r\n      3     finish_reason=\"stop\",\r\n      4     message=msg,\r\n      5 )\r\n\r\nFile /.venv-3.10/lib/python3.10/site-packages/pydantic/main.py:164, in BaseModel.__init__(__pydantic_self__, **data)\r\n    162 # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\r\n    163 __tracebackhide__ = True\r\n--> 164 __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)\r\n\r\nValidationError: 1 validation error for Choice\r\nlogprobs\r\n  Field required [type=missing, input_value={'index': 0, 'finish_reas...=None, tool_calls=None)}, input_type=dict]\r\n    For further information visit https://errors.pydantic.dev/2.5/v/missing\r\n```\r\nSetting `logprobs` to `None` fixes the problem.\r\n```python \r\nfrom openai.types.chat.chat_completion import ChatCompletionMessage, Choice\r\n\r\nmsg = ChatCompletionMessage(role=\"assistant\", content=\"\")\r\n\r\nChoice(\r\n    index=0,\r\n    finish_reason=\"stop\",\r\n    message=msg,\r\n    logprobs=None # added line\r\n)\r\n```\r\n\r\n### Code snippets\r\n\r\n```Python\r\nsee above\r\n```\r\n\r\n\r\n### OS\r\n\r\nLinux\r\n\r\n### Python version\r\n\r\nPython 3.10.13\r\n\r\n### Library version\r\n\r\nopenai 1.6.0\n", "before_files": [{"content": "# File generated from our OpenAPI spec by Stainless.\n\nfrom typing import List, Optional\nfrom typing_extensions import Literal\n\nfrom ..._models import BaseModel\nfrom ..completion_usage import CompletionUsage\nfrom .chat_completion_message import ChatCompletionMessage\nfrom .chat_completion_token_logprob import ChatCompletionTokenLogprob\n\n__all__ = [\"ChatCompletion\", \"Choice\", \"ChoiceLogprobs\"]\n\n\nclass ChoiceLogprobs(BaseModel):\n    content: Optional[List[ChatCompletionTokenLogprob]]\n    \"\"\"A list of message content tokens with log probability information.\"\"\"\n\n\nclass Choice(BaseModel):\n    finish_reason: Literal[\"stop\", \"length\", \"tool_calls\", \"content_filter\", \"function_call\"]\n    \"\"\"The reason the model stopped generating tokens.\n\n    This will be `stop` if the model hit a natural stop point or a provided stop\n    sequence, `length` if the maximum number of tokens specified in the request was\n    reached, `content_filter` if content was omitted due to a flag from our content\n    filters, `tool_calls` if the model called a tool, or `function_call`\n    (deprecated) if the model called a function.\n    \"\"\"\n\n    index: int\n    \"\"\"The index of the choice in the list of choices.\"\"\"\n\n    logprobs: Optional[ChoiceLogprobs]\n    \"\"\"Log probability information for the choice.\"\"\"\n\n    message: ChatCompletionMessage\n    \"\"\"A chat completion message generated by the model.\"\"\"\n\n\nclass ChatCompletion(BaseModel):\n    id: str\n    \"\"\"A unique identifier for the chat completion.\"\"\"\n\n    choices: List[Choice]\n    \"\"\"A list of chat completion choices.\n\n    Can be more than one if `n` is greater than 1.\n    \"\"\"\n\n    created: int\n    \"\"\"The Unix timestamp (in seconds) of when the chat completion was created.\"\"\"\n\n    model: str\n    \"\"\"The model used for the chat completion.\"\"\"\n\n    object: Literal[\"chat.completion\"]\n    \"\"\"The object type, which is always `chat.completion`.\"\"\"\n\n    system_fingerprint: Optional[str] = None\n    \"\"\"This fingerprint represents the backend configuration that the model runs with.\n\n    Can be used in conjunction with the `seed` request parameter to understand when\n    backend changes have been made that might impact determinism.\n    \"\"\"\n\n    usage: Optional[CompletionUsage] = None\n    \"\"\"Usage statistics for the completion request.\"\"\"\n", "path": "src/openai/types/chat/chat_completion.py"}]}