mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-30 07:39:38 +00:00
update router client
This commit is contained in:
parent
46bf0192a1
commit
47a51289ca
2 changed files with 18 additions and 0 deletions
|
@ -98,6 +98,17 @@ async def run_main(host: str, port: int, stream: bool):
|
||||||
async for log in EventLogger().log(iterator):
|
async for log in EventLogger().log(iterator):
|
||||||
log.print()
|
log.print()
|
||||||
|
|
||||||
|
print("Testing a different model provider")
|
||||||
|
iterator = client.chat_completion(
|
||||||
|
ChatCompletionRequest(
|
||||||
|
model="ollama-1",
|
||||||
|
messages=[message],
|
||||||
|
stream=stream,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
async for log in EventLogger().log(iterator):
|
||||||
|
log.print()
|
||||||
|
|
||||||
|
|
||||||
def main(host: str, port: int, stream: bool = True):
|
def main(host: str, port: int, stream: bool = True):
|
||||||
asyncio.run(run_main(host, port, stream))
|
asyncio.run(run_main(host, port, stream))
|
||||||
|
|
|
@ -105,6 +105,13 @@ class OllamaInferenceAdapter(Inference):
|
||||||
delta="",
|
delta="",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
yield ChatCompletionResponseStreamChunk(
|
||||||
|
event=ChatCompletionResponseEvent(
|
||||||
|
event_type=ChatCompletionResponseEventType.progress,
|
||||||
|
delta="model={}, url={}".format(model, self.url),
|
||||||
|
)
|
||||||
|
)
|
||||||
# request = ChatCompletionRequest(
|
# request = ChatCompletionRequest(
|
||||||
# model=model,
|
# model=model,
|
||||||
# messages=messages,
|
# messages=messages,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue