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

Method run

camel/models/samba_model.py:151–170  ·  view source on GitHub ↗

r"""Runs SambaNova's service. Args: messages (List[OpenAIMessage]): Message list with the chat history in OpenAI API format. Returns: Union[ChatCompletion, Stream[ChatCompletionChunk]]: `ChatCompletion` in the non-stream mode,

(  # type: ignore[misc]
        self, messages: List[OpenAIMessage]
    )

Source from the content-addressed store, hash-verified

149 )
150
151 def run( # type: ignore[misc]
152 self, messages: List[OpenAIMessage]
153 ) -> Union[ChatCompletion, Stream[ChatCompletionChunk]]:
154 r"""Runs SambaNova's service.
155
156 Args:
157 messages (List[OpenAIMessage]): Message list with the chat history
158 in OpenAI API format.
159
160 Returns:
161 Union[ChatCompletion, Stream[ChatCompletionChunk]]:
162 `ChatCompletion` in the non-stream mode, or
163 `Stream[ChatCompletionChunk]` in the stream mode.
164 """
165 if "tools" in self.model_config_dict:
166 del self.model_config_dict["tools"]
167 if self.model_config_dict.get("stream") is True:
168 return self._run_streaming(messages)
169 else:
170 return self._run_non_streaming(messages)
171
172 def _run_streaming(
173 self, messages: List[OpenAIMessage]

Callers

nothing calls this directly

Calls 2

_run_streamingMethod · 0.95
_run_non_streamingMethod · 0.95

Tested by

no test coverage detected