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

Method run

camel/models/yi_model.py:84–104  ·  view source on GitHub ↗

r"""Runs inference of Yi chat completion. Args: messages (List[OpenAIMessage]): Message list with the chat history in OpenAI API format. Returns: Union[ChatCompletion, Stream[ChatCompletionChunk]]: `ChatCompletion` in the non-

(
        self,
        messages: List[OpenAIMessage],
    )

Source from the content-addressed store, hash-verified

82 )
83
84 def run(
85 self,
86 messages: List[OpenAIMessage],
87 ) -> Union[ChatCompletion, Stream[ChatCompletionChunk]]:
88 r"""Runs inference of Yi chat completion.
89
90 Args:
91 messages (List[OpenAIMessage]): Message list with the chat history
92 in OpenAI API format.
93
94 Returns:
95 Union[ChatCompletion, Stream[ChatCompletionChunk]]:
96 `ChatCompletion` in the non-stream mode, or
97 `Stream[ChatCompletionChunk]` in the stream mode.
98 """
99 response = self._client.chat.completions.create(
100 messages=messages,
101 model=self.model_type,
102 **self.model_config_dict,
103 )
104 return response
105
106 @property
107 def token_counter(self) -> BaseTokenCounter:

Callers 15

run_pipelineFunction · 0.45
html_to_pngFunction · 0.45
_run_batchMethod · 0.45
get_batch_resultMethod · 0.45
ppt_to_imagesFunction · 0.45
wmf_to_imagesFunction · 0.45
crawler.pyFile · 0.45
kctv_gen_pptFunction · 0.45
is_docker_runningFunction · 0.45
stepMethod · 0.45
process_taskMethod · 0.45
_capture_screenshotFunction · 0.45

Calls 1

createMethod · 0.45

Tested by

no test coverage detected