Skip to content

Commit

Permalink
fix: type of temperature param and adjust defaults for `OpenAIAnswe…
Browse files Browse the repository at this point in the history
…rGenerator` (#3073)

* fix: type of temperature param and adjust defaults

* update schema

* update api docs
  • Loading branch information
tholor authored Sep 16, 2022
1 parent 4ddeb7b commit 3134b0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/_src/api/api/generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ on the [OpenAI API website](https://openai.com/api/).
```python
def __init__(api_key: str,
model: str = "text-curie-001",
max_tokens: int = 7,
max_tokens: int = 13,
top_k: int = 5,
temperature: int = 0,
temperature: float = 0.2,
presence_penalty: float = -2.0,
frequency_penalty: float = -2.0,
examples_context: Optional[str] = None,
Expand Down
6 changes: 3 additions & 3 deletions haystack/json-schemas/haystack-pipeline-main.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3908,7 +3908,7 @@
},
"max_tokens": {
"title": "Max Tokens",
"default": 7,
"default": 13,
"type": "integer"
},
"top_k": {
Expand All @@ -3918,8 +3918,8 @@
},
"temperature": {
"title": "Temperature",
"default": 0,
"type": "integer"
"default": 0.2,
"type": "number"
},
"presence_penalty": {
"title": "Presence Penalty",
Expand Down
4 changes: 2 additions & 2 deletions haystack/nodes/answer_generator/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def __init__(
self,
api_key: str,
model: str = "text-curie-001",
max_tokens: int = 7,
max_tokens: int = 13,
top_k: int = 5,
temperature: int = 0,
temperature: float = 0.2,
presence_penalty: float = -2.0,
frequency_penalty: float = -2.0,
examples_context: Optional[str] = None,
Expand Down

0 comments on commit 3134b0d

Please sign in to comment.