mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-30 00:30:09 +00:00
fix: type of temperature param and adjust defaults for OpenAIAnswerGenerator (#3073)
* fix: type of temperature param and adjust defaults * update schema * update api docs
This commit is contained in:
parent
4ddeb7b14b
commit
3134b0d679
@ -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,
|
||||
|
||||
@ -3908,7 +3908,7 @@
|
||||
},
|
||||
"max_tokens": {
|
||||
"title": "Max Tokens",
|
||||
"default": 7,
|
||||
"default": 13,
|
||||
"type": "integer"
|
||||
},
|
||||
"top_k": {
|
||||
@ -3918,8 +3918,8 @@
|
||||
},
|
||||
"temperature": {
|
||||
"title": "Temperature",
|
||||
"default": 0,
|
||||
"type": "integer"
|
||||
"default": 0.2,
|
||||
"type": "number"
|
||||
},
|
||||
"presence_penalty": {
|
||||
"title": "Presence Penalty",
|
||||
|
||||
@ -28,9 +28,9 @@ class OpenAIAnswerGenerator(BaseGenerator):
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user