Skip to content

Commit 77da046

Browse files
committed
Enable versioning
1 parent 057bf6e commit 77da046

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

weco/client.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ class WecoAI:
2525
"""A client for the WecoAI function builder API that allows users to build and query specialized functions built by LLMs.
2626
The user must simply provide a task description to build a function, and then query the function with an input to get the result they need.
2727
Our client supports both synchronous and asynchronous request paradigms and uses HTTP/2 for faster communication with the API.
28+
Support for multimodality is included.
2829
2930
Attributes
3031
----------
3132
api_key : str
3233
The API key used for authentication.
34+
35+
timeout : float
36+
The timeout for the HTTP requests in seconds. Default is 120.0.
37+
38+
http2 : bool
39+
Whether to use HTTP/2 protocol for the HTTP requests. Default is True.
3340
"""
3441

3542
def __init__(self, api_key: str = None, timeout: float = 120.0, http2: bool = True) -> None:
@@ -41,7 +48,7 @@ def __init__(self, api_key: str = None, timeout: float = 120.0, http2: bool = Tr
4148
The API key used for authentication. If not provided, the client will attempt to read it from the environment variable - WECO_API_KEY.
4249
4350
timeout : float, optional
44-
The timeout for the HTTP requests in seconds (default is 30.0).
51+
The timeout for the HTTP requests in seconds (default is 120.0).
4552
4653
http2 : bool, optional
4754
Whether to use HTTP/2 protocol for the HTTP requests (default is True).
@@ -405,8 +412,6 @@ def _query(
405412
ValueError
406413
If the input is invalid.
407414
"""
408-
warnings.warn("Setting the version number of the function is not yet supported. Currently, the first version of the function will be used i.e., version 0.")
409-
version_number = 0
410415
# Validate the input
411416
image_info = self._validate_query(text_input=text_input, images_input=images_input)
412417

@@ -477,7 +482,7 @@ def query(self, fn_name: str, version_number: Optional[int] = -1, text_input: Op
477482
Returns
478483
-------
479484
dict
480-
A dictionary containing the output of the function, the number of input tokens, the number of output tokens,
485+
A dictionary containing the output of the function, the number of input tokens, the number of output tokens,
481486
and the latency in milliseconds.
482487
"""
483488
return self._query(fn_name=fn_name, version_number=version_number, text_input=text_input, images_input=images_input, is_async=False)

0 commit comments

Comments
 (0)