mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-24 08:22:07 +00:00
Readd tool_prompt
This commit is contained in:
parent
2f644779cb
commit
4607b7e9c4
@ -171,6 +171,7 @@ class Client:
|
|||||||
temperature: Optional[float] = None,
|
temperature: Optional[float] = None,
|
||||||
top_p: Optional[float] = None,
|
top_p: Optional[float] = None,
|
||||||
tools: Optional[List[Tool]] = None,
|
tools: Optional[List[Tool]] = None,
|
||||||
|
tool_prompt: Optional[str] = None,
|
||||||
tool_choice: Optional[str] = None,
|
tool_choice: Optional[str] = None,
|
||||||
stop: Optional[List[str]] = None,
|
stop: Optional[List[str]] = None,
|
||||||
):
|
):
|
||||||
@ -211,6 +212,8 @@ class Client:
|
|||||||
higher are kept for generation
|
higher are kept for generation
|
||||||
tools (`List[Tool]`):
|
tools (`List[Tool]`):
|
||||||
List of tools to use
|
List of tools to use
|
||||||
|
tool_prompt (`str`):
|
||||||
|
A prompt to be appended before the tools
|
||||||
tool_choice (`str`):
|
tool_choice (`str`):
|
||||||
The tool to use
|
The tool to use
|
||||||
stop (`List[str]`):
|
stop (`List[str]`):
|
||||||
@ -233,6 +236,7 @@ class Client:
|
|||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
top_p=top_p,
|
top_p=top_p,
|
||||||
tools=tools,
|
tools=tools,
|
||||||
|
tool_prompt=tool_prompt,
|
||||||
tool_choice=tool_choice,
|
tool_choice=tool_choice,
|
||||||
stop=stop,
|
stop=stop,
|
||||||
)
|
)
|
||||||
@ -648,6 +652,7 @@ class AsyncClient:
|
|||||||
temperature: Optional[float] = None,
|
temperature: Optional[float] = None,
|
||||||
top_p: Optional[float] = None,
|
top_p: Optional[float] = None,
|
||||||
tools: Optional[List[Tool]] = None,
|
tools: Optional[List[Tool]] = None,
|
||||||
|
tool_prompt: Optional[str] = None,
|
||||||
tool_choice: Optional[str] = None,
|
tool_choice: Optional[str] = None,
|
||||||
stop: Optional[List[str]] = None,
|
stop: Optional[List[str]] = None,
|
||||||
) -> Union[ChatComplete, AsyncIterator[ChatCompletionChunk]]:
|
) -> Union[ChatComplete, AsyncIterator[ChatCompletionChunk]]:
|
||||||
@ -688,6 +693,8 @@ class AsyncClient:
|
|||||||
higher are kept for generation
|
higher are kept for generation
|
||||||
tools (`List[Tool]`):
|
tools (`List[Tool]`):
|
||||||
List of tools to use
|
List of tools to use
|
||||||
|
tool_prompt (`str`):
|
||||||
|
A prompt to be appended before the tools
|
||||||
tool_choice (`str`):
|
tool_choice (`str`):
|
||||||
The tool to use
|
The tool to use
|
||||||
stop (`List[str]`):
|
stop (`List[str]`):
|
||||||
@ -710,6 +717,7 @@ class AsyncClient:
|
|||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
top_p=top_p,
|
top_p=top_p,
|
||||||
tools=tools,
|
tools=tools,
|
||||||
|
tool_prompt=tool_prompt,
|
||||||
tool_choice=tool_choice,
|
tool_choice=tool_choice,
|
||||||
stop=stop,
|
stop=stop,
|
||||||
)
|
)
|
||||||
@ -967,4 +975,4 @@ class AsyncClient:
|
|||||||
except ValidationError:
|
except ValidationError:
|
||||||
# If we failed to parse the payload, then it is an error payload
|
# If we failed to parse the payload, then it is an error payload
|
||||||
raise parse_error(resp.status, json_payload)
|
raise parse_error(resp.status, json_payload)
|
||||||
yield response
|
yield response
|
@ -453,4 +453,4 @@ class StreamResponse(BaseModel):
|
|||||||
# Inference API currently deployed model
|
# Inference API currently deployed model
|
||||||
class DeployedModel(BaseModel):
|
class DeployedModel(BaseModel):
|
||||||
model_id: str
|
model_id: str
|
||||||
sha: str
|
sha: str
|
Loading…
Reference in New Issue
Block a user