Skip to content

Commit 3134b0d

Browse files
authored
fix: type of temperature param and adjust defaults for OpenAIAnswerGenerator (#3073)
* fix: type of temperature param and adjust defaults * update schema * update api docs
1 parent 4ddeb7b commit 3134b0d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/_src/api/api/generator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ on the [OpenAI API website](https://openai.com/api/).
370370
```python
371371
def __init__(api_key: str,
372372
model: str = "text-curie-001",
373-
max_tokens: int = 7,
373+
max_tokens: int = 13,
374374
top_k: int = 5,
375-
temperature: int = 0,
375+
temperature: float = 0.2,
376376
presence_penalty: float = -2.0,
377377
frequency_penalty: float = -2.0,
378378
examples_context: Optional[str] = None,

haystack/json-schemas/haystack-pipeline-main.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3908,7 +3908,7 @@
39083908
},
39093909
"max_tokens": {
39103910
"title": "Max Tokens",
3911-
"default": 7,
3911+
"default": 13,
39123912
"type": "integer"
39133913
},
39143914
"top_k": {
@@ -3918,8 +3918,8 @@
39183918
},
39193919
"temperature": {
39203920
"title": "Temperature",
3921-
"default": 0,
3922-
"type": "integer"
3921+
"default": 0.2,
3922+
"type": "number"
39233923
},
39243924
"presence_penalty": {
39253925
"title": "Presence Penalty",

haystack/nodes/answer_generator/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def __init__(
2828
self,
2929
api_key: str,
3030
model: str = "text-curie-001",
31-
max_tokens: int = 7,
31+
max_tokens: int = 13,
3232
top_k: int = 5,
33-
temperature: int = 0,
33+
temperature: float = 0.2,
3434
presence_penalty: float = -2.0,
3535
frequency_penalty: float = -2.0,
3636
examples_context: Optional[str] = None,

0 commit comments

Comments
 (0)