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

Method __init__

camel/models/yi_model.py:60–82  ·  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

58 ]
59 )
60 def __init__(
61 self,
62 model_type: Union[ModelType, str],
63 model_config_dict: Optional[Dict[str, Any]] = None,
64 api_key: Optional[str] = None,
65 url: Optional[str] = None,
66 token_counter: Optional[BaseTokenCounter] = None,
67 ) -> None:
68 if model_config_dict is None:
69 model_config_dict = YiConfig().as_dict()
70 api_key = api_key or os.environ.get("YI_API_KEY")
71 url = url or os.environ.get(
72 "YI_API_BASE_URL", "https://api.lingyiwanwu.com/v1"
73 )
74 super().__init__(
75 model_type, model_config_dict, api_key, url, token_counter
76 )
77 self._client = OpenAI(
78 timeout=180,
79 max_retries=3,
80 api_key=self._api_key,
81 base_url=self._url,
82 )
83
84 def run(
85 self,

Callers

nothing calls this directly

Calls 2

YiConfigClass · 0.90
as_dictMethod · 0.45

Tested by

no test coverage detected