mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 20:14:13 +00:00
[1/n] migrate inference/chat_completion
This commit is contained in:
parent
1433aaf9f7
commit
0c7c6b7e02
3 changed files with 35 additions and 7 deletions
|
@ -10,10 +10,10 @@ from typing import Any, AsyncGenerator
|
|||
|
||||
import fire
|
||||
import httpx
|
||||
from pydantic import BaseModel
|
||||
from termcolor import cprint
|
||||
|
||||
from llama_toolchain.core.datatypes import RemoteProviderConfig
|
||||
from pydantic import BaseModel
|
||||
from termcolor import cprint
|
||||
|
||||
from .api import (
|
||||
ChatCompletionRequest,
|
||||
|
@ -52,9 +52,7 @@ class InferenceClient(Inference):
|
|||
async with client.stream(
|
||||
"POST",
|
||||
f"{self.base_url}/inference/chat_completion",
|
||||
json={
|
||||
"request": encodable_dict(request),
|
||||
},
|
||||
json=encodable_dict(request),
|
||||
headers={"Content-Type": "application/json"},
|
||||
timeout=20,
|
||||
) as response:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue