We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`user_bio` is None by default, get an error when replacing the character names
### Describe the bug
Using API `/v1/chat/completions` (None stream mode) without `user_bio`.

----

The new parameter `user_bio` in API chat mode raises an error because it's `None` as default.
https://github.com/oobabooga/text-generation-webui/blob/7cf1402bde48fd76af501d5efecb34227bf4d082/extensions/openai/typing.py#L110

----

Then, in `chat.py` can't replace the names correctly.
https://github.com/oobabooga/text-generation-webui/blob/7cf1402bde48fd76af501d5efecb34227bf4d082/modules/chat.py#L97

get this error
![image](https://github.com/oobabooga/text-generation-webui/assets/15323975/8d5f9519-33d5-48e8-809c-7dd29e43eee2)

-----

An empty string as default in webui.
https://github.com/oobabooga/text-generation-webui/blob/7cf1402bde48fd76af501d5efecb34227bf4d082/modules/shared.py#L60



### Is there an existing issue for this?

- [X] I have searched the existing issues

### Reproduction

Any request in `/v1/chat/completions`

### Screenshot

_No response_

### Logs

```shell
    text = text.replace('{{user}}', name1).replace('{{char}}', name2)
AttributeError: 'NoneType' object has no attribute 'replace'
```


### System Info

```shell
None
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `extensions/openai/typing.py`
Content:
```
1 import json
2 import time
3 from typing import Dict, List
4 
5 from pydantic import BaseModel, Field
6 
7 
8 class GenerationOptions(BaseModel):
9     preset: str | None = Field(default=None, description="The name of a file under text-generation-webui/presets (without the .yaml extension). The sampling parameters that get overwritten by this option are the keys in the default_preset() function in modules/presets.py.")
10     min_p: float = 0
11     dynamic_temperature: bool = False
12     dynatemp_low: float = 1
13     dynatemp_high: float = 1
14     dynatemp_exponent: float = 1
15     smoothing_factor: float = 0
16     smoothing_curve: float = 1
17     top_k: int = 0
18     repetition_penalty: float = 1
19     repetition_penalty_range: int = 1024
20     typical_p: float = 1
21     tfs: float = 1
22     top_a: float = 0
23     epsilon_cutoff: float = 0
24     eta_cutoff: float = 0
25     guidance_scale: float = 1
26     negative_prompt: str = ''
27     penalty_alpha: float = 0
28     mirostat_mode: int = 0
29     mirostat_tau: float = 5
30     mirostat_eta: float = 0.1
31     temperature_last: bool = False
32     do_sample: bool = True
33     seed: int = -1
34     encoder_repetition_penalty: float = 1
35     no_repeat_ngram_size: int = 0
36     min_length: int = 0
37     num_beams: int = 1
38     length_penalty: float = 1
39     early_stopping: bool = False
40     truncation_length: int = 0
41     max_tokens_second: int = 0
42     prompt_lookup_num_tokens: int = 0
43     custom_token_bans: str = ""
44     sampler_priority: List[str] | str | None = Field(default=None, description="List of samplers where the first items will appear first in the stack. Example: [\"top_k\", \"temperature\", \"top_p\"].")
45     auto_max_new_tokens: bool = False
46     ban_eos_token: bool = False
47     add_bos_token: bool = True
48     skip_special_tokens: bool = True
49     grammar_string: str = ""
50 
51 
52 class CompletionRequestParams(BaseModel):
53     model: str | None = Field(default=None, description="Unused parameter. To change the model, use the /v1/internal/model/load endpoint.")
54     prompt: str | List[str]
55     best_of: int | None = Field(default=1, description="Unused parameter.")
56     echo: bool | None = False
57     frequency_penalty: float | None = 0
58     logit_bias: dict | None = None
59     logprobs: int | None = None
60     max_tokens: int | None = 16
61     n: int | None = Field(default=1, description="Unused parameter.")
62     presence_penalty: float | None = 0
63     stop: str | List[str] | None = None
64     stream: bool | None = False
65     suffix: str | None = None
66     temperature: float | None = 1
67     top_p: float | None = 1
68     user: str | None = Field(default=None, description="Unused parameter.")
69 
70 
71 class CompletionRequest(GenerationOptions, CompletionRequestParams):
72     pass
73 
74 
75 class CompletionResponse(BaseModel):
76     id: str
77     choices: List[dict]
78     created: int = int(time.time())
79     model: str
80     object: str = "text_completion"
81     usage: dict
82 
83 
84 class ChatCompletionRequestParams(BaseModel):
85     messages: List[dict]
86     model: str | None = Field(default=None, description="Unused parameter. To change the model, use the /v1/internal/model/load endpoint.")
87     frequency_penalty: float | None = 0
88     function_call: str | dict | None = Field(default=None, description="Unused parameter.")
89     functions: List[dict] | None = Field(default=None, description="Unused parameter.")
90     logit_bias: dict | None = None
91     max_tokens: int | None = None
92     n: int | None = Field(default=1, description="Unused parameter.")
93     presence_penalty: float | None = 0
94     stop: str | List[str] | None = None
95     stream: bool | None = False
96     temperature: float | None = 1
97     top_p: float | None = 1
98     user: str | None = Field(default=None, description="Unused parameter.")
99 
100     mode: str = Field(default='instruct', description="Valid options: instruct, chat, chat-instruct.")
101 
102     instruction_template: str | None = Field(default=None, description="An instruction template defined under text-generation-webui/instruction-templates. If not set, the correct template will be automatically obtained from the model metadata.")
103     instruction_template_str: str | None = Field(default=None, description="A Jinja2 instruction template. If set, will take precedence over everything else.")
104 
105     character: str | None = Field(default=None, description="A character defined under text-generation-webui/characters. If not set, the default \"Assistant\" character will be used.")
106     bot_name: str | None = Field(default=None, description="Overwrites the value set by character field.", alias="name2")
107     context: str | None = Field(default=None, description="Overwrites the value set by character field.")
108     greeting: str | None = Field(default=None, description="Overwrites the value set by character field.")
109     user_name: str | None = Field(default=None, description="Your name (the user). By default, it's \"You\".", alias="name1")
110     user_bio: str | None = Field(default=None, description="The user description/personality.")
111     chat_template_str: str | None = Field(default=None, description="Jinja2 template for chat.")
112 
113     chat_instruct_command: str | None = None
114 
115     continue_: bool = Field(default=False, description="Makes the last bot message in the history be continued instead of starting a new message.")
116 
117 
118 class ChatCompletionRequest(GenerationOptions, ChatCompletionRequestParams):
119     pass
120 
121 
122 class ChatCompletionResponse(BaseModel):
123     id: str
124     choices: List[dict]
125     created: int = int(time.time())
126     model: str
127     object: str = "chat.completion"
128     usage: dict
129 
130 
131 class EmbeddingsRequest(BaseModel):
132     input: str | List[str] | List[int] | List[List[int]]
133     model: str | None = Field(default=None, description="Unused parameter. To change the model, set the OPENEDAI_EMBEDDING_MODEL and OPENEDAI_EMBEDDING_DEVICE environment variables before starting the server.")
134     encoding_format: str = Field(default="float", description="Can be float or base64.")
135     user: str | None = Field(default=None, description="Unused parameter.")
136 
137 
138 class EmbeddingsResponse(BaseModel):
139     index: int
140     embedding: List[float]
141     object: str = "embedding"
142 
143 
144 class EncodeRequest(BaseModel):
145     text: str
146 
147 
148 class EncodeResponse(BaseModel):
149     tokens: List[int]
150     length: int
151 
152 
153 class DecodeRequest(BaseModel):
154     tokens: List[int]
155 
156 
157 class DecodeResponse(BaseModel):
158     text: str
159 
160 
161 class TokenCountResponse(BaseModel):
162     length: int
163 
164 
165 class LogitsRequestParams(BaseModel):
166     prompt: str
167     use_samplers: bool = False
168     top_logits: int | None = 50
169     frequency_penalty: float | None = 0
170     max_tokens: int | None = 16
171     presence_penalty: float | None = 0
172     temperature: float | None = 1
173     top_p: float | None = 1
174 
175 
176 class LogitsRequest(GenerationOptions, LogitsRequestParams):
177     pass
178 
179 
180 class LogitsResponse(BaseModel):
181     logits: Dict[str, float]
182 
183 
184 class ModelInfoResponse(BaseModel):
185     model_name: str
186     lora_names: List[str]
187 
188 
189 class ModelListResponse(BaseModel):
190     model_names: List[str]
191 
192 
193 class LoadModelRequest(BaseModel):
194     model_name: str
195     args: dict | None = None
196     settings: dict | None = None
197 
198 
199 class LoraListResponse(BaseModel):
200     lora_names: List[str]
201 
202 
203 class LoadLorasRequest(BaseModel):
204     lora_names: List[str]
205 
206 
207 def to_json(obj):
208     return json.dumps(obj.__dict__, indent=4)
209 
210 
211 def to_dict(obj):
212     return obj.__dict__
213
```
--- 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()

```

diff --git a/extensions/openai/typing.py b/extensions/openai/typing.py
--- a/extensions/openai/typing.py
+++ b/extensions/openai/typing.py
@@ -107,7 +107,7 @@
     context: str | None = Field(default=None, description="Overwrites the value set by character field.")
     greeting: str | None = Field(default=None, description="Overwrites the value set by character field.")
     user_name: str | None = Field(default=None, description="Your name (the user). By default, it's \"You\".", alias="name1")
-    user_bio: str | None = Field(default=None, description="The user description/personality.")
+    user_bio: str | None = Field(default='', description="The user description/personality.")
     chat_template_str: str | None = Field(default=None, description="Jinja2 template for chat.")
 
     chat_instruct_command: str | None = None

{"golden_diff": "diff --git a/extensions/openai/typing.py b/extensions/openai/typing.py\n--- a/extensions/openai/typing.py\n+++ b/extensions/openai/typing.py\n@@ -107,7 +107,7 @@\n     context: str | None = Field(default=None, description=\"Overwrites the value set by character field.\")\n     greeting: str | None = Field(default=None, description=\"Overwrites the value set by character field.\")\n     user_name: str | None = Field(default=None, description=\"Your name (the user). By default, it's \\\"You\\\".\", alias=\"name1\")\n-    user_bio: str | None = Field(default=None, description=\"The user description/personality.\")\n+    user_bio: str | None = Field(default='', description=\"The user description/personality.\")\n     chat_template_str: str | None = Field(default=None, description=\"Jinja2 template for chat.\")\n \n     chat_instruct_command: str | None = None\n", "issue": "`user_bio` is None by default, get an error when replacing the character names\n### Describe the bug\r\nUsing API `/v1/chat/completions` (None stream mode) without `user_bio`.\r\n\r\n----\r\n\r\nThe new parameter `user_bio` in API chat mode raises an error because it's `None` as default.\r\nhttps://github.com/oobabooga/text-generation-webui/blob/7cf1402bde48fd76af501d5efecb34227bf4d082/extensions/openai/typing.py#L110\r\n\r\n----\r\n\r\nThen, in `chat.py` can't replace the names correctly.\r\nhttps://github.com/oobabooga/text-generation-webui/blob/7cf1402bde48fd76af501d5efecb34227bf4d082/modules/chat.py#L97\r\n\r\nget this error\r\n![image](https://github.com/oobabooga/text-generation-webui/assets/15323975/8d5f9519-33d5-48e8-809c-7dd29e43eee2)\r\n\r\n-----\r\n\r\nAn empty string as default in webui.\r\nhttps://github.com/oobabooga/text-generation-webui/blob/7cf1402bde48fd76af501d5efecb34227bf4d082/modules/shared.py#L60\r\n\r\n\r\n\r\n### Is there an existing issue for this?\r\n\r\n- [X] I have searched the existing issues\r\n\r\n### Reproduction\r\n\r\nAny request in `/v1/chat/completions`\r\n\r\n### Screenshot\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n```shell\r\n    text = text.replace('{{user}}', name1).replace('{{char}}', name2)\r\nAttributeError: 'NoneType' object has no attribute 'replace'\r\n```\r\n\r\n\r\n### System Info\r\n\r\n```shell\r\nNone\r\n```\r\n\n", "before_files": [{"content": "import json\nimport time\nfrom typing import Dict, List\n\nfrom pydantic import BaseModel, Field\n\n\nclass GenerationOptions(BaseModel):\n    preset: str | None = Field(default=None, description=\"The name of a file under text-generation-webui/presets (without the .yaml extension). The sampling parameters that get overwritten by this option are the keys in the default_preset() function in modules/presets.py.\")\n    min_p: float = 0\n    dynamic_temperature: bool = False\n    dynatemp_low: float = 1\n    dynatemp_high: float = 1\n    dynatemp_exponent: float = 1\n    smoothing_factor: float = 0\n    smoothing_curve: float = 1\n    top_k: int = 0\n    repetition_penalty: float = 1\n    repetition_penalty_range: int = 1024\n    typical_p: float = 1\n    tfs: float = 1\n    top_a: float = 0\n    epsilon_cutoff: float = 0\n    eta_cutoff: float = 0\n    guidance_scale: float = 1\n    negative_prompt: str = ''\n    penalty_alpha: float = 0\n    mirostat_mode: int = 0\n    mirostat_tau: float = 5\n    mirostat_eta: float = 0.1\n    temperature_last: bool = False\n    do_sample: bool = True\n    seed: int = -1\n    encoder_repetition_penalty: float = 1\n    no_repeat_ngram_size: int = 0\n    min_length: int = 0\n    num_beams: int = 1\n    length_penalty: float = 1\n    early_stopping: bool = False\n    truncation_length: int = 0\n    max_tokens_second: int = 0\n    prompt_lookup_num_tokens: int = 0\n    custom_token_bans: str = \"\"\n    sampler_priority: List[str] | str | None = Field(default=None, description=\"List of samplers where the first items will appear first in the stack. Example: [\\\"top_k\\\", \\\"temperature\\\", \\\"top_p\\\"].\")\n    auto_max_new_tokens: bool = False\n    ban_eos_token: bool = False\n    add_bos_token: bool = True\n    skip_special_tokens: bool = True\n    grammar_string: str = \"\"\n\n\nclass CompletionRequestParams(BaseModel):\n    model: str | None = Field(default=None, description=\"Unused parameter. To change the model, use the /v1/internal/model/load endpoint.\")\n    prompt: str | List[str]\n    best_of: int | None = Field(default=1, description=\"Unused parameter.\")\n    echo: bool | None = False\n    frequency_penalty: float | None = 0\n    logit_bias: dict | None = None\n    logprobs: int | None = None\n    max_tokens: int | None = 16\n    n: int | None = Field(default=1, description=\"Unused parameter.\")\n    presence_penalty: float | None = 0\n    stop: str | List[str] | None = None\n    stream: bool | None = False\n    suffix: str | None = None\n    temperature: float | None = 1\n    top_p: float | None = 1\n    user: str | None = Field(default=None, description=\"Unused parameter.\")\n\n\nclass CompletionRequest(GenerationOptions, CompletionRequestParams):\n    pass\n\n\nclass CompletionResponse(BaseModel):\n    id: str\n    choices: List[dict]\n    created: int = int(time.time())\n    model: str\n    object: str = \"text_completion\"\n    usage: dict\n\n\nclass ChatCompletionRequestParams(BaseModel):\n    messages: List[dict]\n    model: str | None = Field(default=None, description=\"Unused parameter. To change the model, use the /v1/internal/model/load endpoint.\")\n    frequency_penalty: float | None = 0\n    function_call: str | dict | None = Field(default=None, description=\"Unused parameter.\")\n    functions: List[dict] | None = Field(default=None, description=\"Unused parameter.\")\n    logit_bias: dict | None = None\n    max_tokens: int | None = None\n    n: int | None = Field(default=1, description=\"Unused parameter.\")\n    presence_penalty: float | None = 0\n    stop: str | List[str] | None = None\n    stream: bool | None = False\n    temperature: float | None = 1\n    top_p: float | None = 1\n    user: str | None = Field(default=None, description=\"Unused parameter.\")\n\n    mode: str = Field(default='instruct', description=\"Valid options: instruct, chat, chat-instruct.\")\n\n    instruction_template: str | None = Field(default=None, description=\"An instruction template defined under text-generation-webui/instruction-templates. If not set, the correct template will be automatically obtained from the model metadata.\")\n    instruction_template_str: str | None = Field(default=None, description=\"A Jinja2 instruction template. If set, will take precedence over everything else.\")\n\n    character: str | None = Field(default=None, description=\"A character defined under text-generation-webui/characters. If not set, the default \\\"Assistant\\\" character will be used.\")\n    bot_name: str | None = Field(default=None, description=\"Overwrites the value set by character field.\", alias=\"name2\")\n    context: str | None = Field(default=None, description=\"Overwrites the value set by character field.\")\n    greeting: str | None = Field(default=None, description=\"Overwrites the value set by character field.\")\n    user_name: str | None = Field(default=None, description=\"Your name (the user). By default, it's \\\"You\\\".\", alias=\"name1\")\n    user_bio: str | None = Field(default=None, description=\"The user description/personality.\")\n    chat_template_str: str | None = Field(default=None, description=\"Jinja2 template for chat.\")\n\n    chat_instruct_command: str | None = None\n\n    continue_: bool = Field(default=False, description=\"Makes the last bot message in the history be continued instead of starting a new message.\")\n\n\nclass ChatCompletionRequest(GenerationOptions, ChatCompletionRequestParams):\n    pass\n\n\nclass ChatCompletionResponse(BaseModel):\n    id: str\n    choices: List[dict]\n    created: int = int(time.time())\n    model: str\n    object: str = \"chat.completion\"\n    usage: dict\n\n\nclass EmbeddingsRequest(BaseModel):\n    input: str | List[str] | List[int] | List[List[int]]\n    model: str | None = Field(default=None, description=\"Unused parameter. To change the model, set the OPENEDAI_EMBEDDING_MODEL and OPENEDAI_EMBEDDING_DEVICE environment variables before starting the server.\")\n    encoding_format: str = Field(default=\"float\", description=\"Can be float or base64.\")\n    user: str | None = Field(default=None, description=\"Unused parameter.\")\n\n\nclass EmbeddingsResponse(BaseModel):\n    index: int\n    embedding: List[float]\n    object: str = \"embedding\"\n\n\nclass EncodeRequest(BaseModel):\n    text: str\n\n\nclass EncodeResponse(BaseModel):\n    tokens: List[int]\n    length: int\n\n\nclass DecodeRequest(BaseModel):\n    tokens: List[int]\n\n\nclass DecodeResponse(BaseModel):\n    text: str\n\n\nclass TokenCountResponse(BaseModel):\n    length: int\n\n\nclass LogitsRequestParams(BaseModel):\n    prompt: str\n    use_samplers: bool = False\n    top_logits: int | None = 50\n    frequency_penalty: float | None = 0\n    max_tokens: int | None = 16\n    presence_penalty: float | None = 0\n    temperature: float | None = 1\n    top_p: float | None = 1\n\n\nclass LogitsRequest(GenerationOptions, LogitsRequestParams):\n    pass\n\n\nclass LogitsResponse(BaseModel):\n    logits: Dict[str, float]\n\n\nclass ModelInfoResponse(BaseModel):\n    model_name: str\n    lora_names: List[str]\n\n\nclass ModelListResponse(BaseModel):\n    model_names: List[str]\n\n\nclass LoadModelRequest(BaseModel):\n    model_name: str\n    args: dict | None = None\n    settings: dict | None = None\n\n\nclass LoraListResponse(BaseModel):\n    lora_names: List[str]\n\n\nclass LoadLorasRequest(BaseModel):\n    lora_names: List[str]\n\n\ndef to_json(obj):\n    return json.dumps(obj.__dict__, indent=4)\n\n\ndef to_dict(obj):\n    return obj.__dict__\n", "path": "extensions/openai/typing.py"}], "after_files": [{"content": "import json\nimport time\nfrom typing import Dict, List\n\nfrom pydantic import BaseModel, Field\n\n\nclass GenerationOptions(BaseModel):\n    preset: str | None = Field(default=None, description=\"The name of a file under text-generation-webui/presets (without the .yaml extension). The sampling parameters that get overwritten by this option are the keys in the default_preset() function in modules/presets.py.\")\n    min_p: float = 0\n    dynamic_temperature: bool = False\n    dynatemp_low: float = 1\n    dynatemp_high: float = 1\n    dynatemp_exponent: float = 1\n    smoothing_factor: float = 0\n    smoothing_curve: float = 1\n    top_k: int = 0\n    repetition_penalty: float = 1\n    repetition_penalty_range: int = 1024\n    typical_p: float = 1\n    tfs: float = 1\n    top_a: float = 0\n    epsilon_cutoff: float = 0\n    eta_cutoff: float = 0\n    guidance_scale: float = 1\n    negative_prompt: str = ''\n    penalty_alpha: float = 0\n    mirostat_mode: int = 0\n    mirostat_tau: float = 5\n    mirostat_eta: float = 0.1\n    temperature_last: bool = False\n    do_sample: bool = True\n    seed: int = -1\n    encoder_repetition_penalty: float = 1\n    no_repeat_ngram_size: int = 0\n    min_length: int = 0\n    num_beams: int = 1\n    length_penalty: float = 1\n    early_stopping: bool = False\n    truncation_length: int = 0\n    max_tokens_second: int = 0\n    prompt_lookup_num_tokens: int = 0\n    custom_token_bans: str = \"\"\n    sampler_priority: List[str] | str | None = Field(default=None, description=\"List of samplers where the first items will appear first in the stack. Example: [\\\"top_k\\\", \\\"temperature\\\", \\\"top_p\\\"].\")\n    auto_max_new_tokens: bool = False\n    ban_eos_token: bool = False\n    add_bos_token: bool = True\n    skip_special_tokens: bool = True\n    grammar_string: str = \"\"\n\n\nclass CompletionRequestParams(BaseModel):\n    model: str | None = Field(default=None, description=\"Unused parameter. To change the model, use the /v1/internal/model/load endpoint.\")\n    prompt: str | List[str]\n    best_of: int | None = Field(default=1, description=\"Unused parameter.\")\n    echo: bool | None = False\n    frequency_penalty: float | None = 0\n    logit_bias: dict | None = None\n    logprobs: int | None = None\n    max_tokens: int | None = 16\n    n: int | None = Field(default=1, description=\"Unused parameter.\")\n    presence_penalty: float | None = 0\n    stop: str | List[str] | None = None\n    stream: bool | None = False\n    suffix: str | None = None\n    temperature: float | None = 1\n    top_p: float | None = 1\n    user: str | None = Field(default=None, description=\"Unused parameter.\")\n\n\nclass CompletionRequest(GenerationOptions, CompletionRequestParams):\n    pass\n\n\nclass CompletionResponse(BaseModel):\n    id: str\n    choices: List[dict]\n    created: int = int(time.time())\n    model: str\n    object: str = \"text_completion\"\n    usage: dict\n\n\nclass ChatCompletionRequestParams(BaseModel):\n    messages: List[dict]\n    model: str | None = Field(default=None, description=\"Unused parameter. To change the model, use the /v1/internal/model/load endpoint.\")\n    frequency_penalty: float | None = 0\n    function_call: str | dict | None = Field(default=None, description=\"Unused parameter.\")\n    functions: List[dict] | None = Field(default=None, description=\"Unused parameter.\")\n    logit_bias: dict | None = None\n    max_tokens: int | None = None\n    n: int | None = Field(default=1, description=\"Unused parameter.\")\n    presence_penalty: float | None = 0\n    stop: str | List[str] | None = None\n    stream: bool | None = False\n    temperature: float | None = 1\n    top_p: float | None = 1\n    user: str | None = Field(default=None, description=\"Unused parameter.\")\n\n    mode: str = Field(default='instruct', description=\"Valid options: instruct, chat, chat-instruct.\")\n\n    instruction_template: str | None = Field(default=None, description=\"An instruction template defined under text-generation-webui/instruction-templates. If not set, the correct template will be automatically obtained from the model metadata.\")\n    instruction_template_str: str | None = Field(default=None, description=\"A Jinja2 instruction template. If set, will take precedence over everything else.\")\n\n    character: str | None = Field(default=None, description=\"A character defined under text-generation-webui/characters. If not set, the default \\\"Assistant\\\" character will be used.\")\n    bot_name: str | None = Field(default=None, description=\"Overwrites the value set by character field.\", alias=\"name2\")\n    context: str | None = Field(default=None, description=\"Overwrites the value set by character field.\")\n    greeting: str | None = Field(default=None, description=\"Overwrites the value set by character field.\")\n    user_name: str | None = Field(default=None, description=\"Your name (the user). By default, it's \\\"You\\\".\", alias=\"name1\")\n    user_bio: str | None = Field(default='', description=\"The user description/personality.\")\n    chat_template_str: str | None = Field(default=None, description=\"Jinja2 template for chat.\")\n\n    chat_instruct_command: str | None = None\n\n    continue_: bool = Field(default=False, description=\"Makes the last bot message in the history be continued instead of starting a new message.\")\n\n\nclass ChatCompletionRequest(GenerationOptions, ChatCompletionRequestParams):\n    pass\n\n\nclass ChatCompletionResponse(BaseModel):\n    id: str\n    choices: List[dict]\n    created: int = int(time.time())\n    model: str\n    object: str = \"chat.completion\"\n    usage: dict\n\n\nclass EmbeddingsRequest(BaseModel):\n    input: str | List[str] | List[int] | List[List[int]]\n    model: str | None = Field(default=None, description=\"Unused parameter. To change the model, set the OPENEDAI_EMBEDDING_MODEL and OPENEDAI_EMBEDDING_DEVICE environment variables before starting the server.\")\n    encoding_format: str = Field(default=\"float\", description=\"Can be float or base64.\")\n    user: str | None = Field(default=None, description=\"Unused parameter.\")\n\n\nclass EmbeddingsResponse(BaseModel):\n    index: int\n    embedding: List[float]\n    object: str = \"embedding\"\n\n\nclass EncodeRequest(BaseModel):\n    text: str\n\n\nclass EncodeResponse(BaseModel):\n    tokens: List[int]\n    length: int\n\n\nclass DecodeRequest(BaseModel):\n    tokens: List[int]\n\n\nclass DecodeResponse(BaseModel):\n    text: str\n\n\nclass TokenCountResponse(BaseModel):\n    length: int\n\n\nclass LogitsRequestParams(BaseModel):\n    prompt: str\n    use_samplers: bool = False\n    top_logits: int | None = 50\n    frequency_penalty: float | None = 0\n    max_tokens: int | None = 16\n    presence_penalty: float | None = 0\n    temperature: float | None = 1\n    top_p: float | None = 1\n\n\nclass LogitsRequest(GenerationOptions, LogitsRequestParams):\n    pass\n\n\nclass LogitsResponse(BaseModel):\n    logits: Dict[str, float]\n\n\nclass ModelInfoResponse(BaseModel):\n    model_name: str\n    lora_names: List[str]\n\n\nclass ModelListResponse(BaseModel):\n    model_names: List[str]\n\n\nclass LoadModelRequest(BaseModel):\n    model_name: str\n    args: dict | None = None\n    settings: dict | None = None\n\n\nclass LoraListResponse(BaseModel):\n    lora_names: List[str]\n\n\nclass LoadLorasRequest(BaseModel):\n    lora_names: List[str]\n\n\ndef to_json(obj):\n    return json.dumps(obj.__dict__, indent=4)\n\n\ndef to_dict(obj):\n    return obj.__dict__\n", "path": "extensions/openai/typing.py"}]}