MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / __init__

Method __init__

camel/models/samba_model.py:82–107  ·  view source on GitHub ↗
(
        self,
        model_type: Union[ModelType, str],
        model_config_dict: Optional[Dict[str, Any]] = None,
        api_key: Optional[str] = None,
        url: Optional[str] = None,
        token_counter: Optional[BaseTokenCounter] = None,
    )

Source from the content-addressed store, hash-verified

80 ]
81 )
82 def __init__(
83 self,
84 model_type: Union[ModelType, str],
85 model_config_dict: Optional[Dict[str, Any]] = None,
86 api_key: Optional[str] = None,
87 url: Optional[str] = None,
88 token_counter: Optional[BaseTokenCounter] = None,
89 ) -> None:
90 if model_config_dict is None:
91 model_config_dict = SambaCloudAPIConfig().as_dict()
92 api_key = api_key or os.environ.get("SAMBA_API_KEY")
93 url = url or os.environ.get(
94 "SAMBA_API_BASE_URL",
95 "https://api.sambanova.ai/v1",
96 )
97 super().__init__(
98 model_type, model_config_dict, api_key, url, token_counter
99 )
100
101 if self._url == "https://api.sambanova.ai/v1":
102 self._client = OpenAI(
103 timeout=180,
104 max_retries=3,
105 base_url=self._url,
106 api_key=self._api_key,
107 )
108
109 @property
110 def token_counter(self) -> BaseTokenCounter:

Callers

nothing calls this directly

Calls 2

SambaCloudAPIConfigClass · 0.90
as_dictMethod · 0.45

Tested by

no test coverage detected