mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
use native endpoints
This commit is contained in:
parent
af04bbecca
commit
64c008045f
4 changed files with 131 additions and 72 deletions
|
@ -241,12 +241,13 @@ class VertexFineTuningAPI(VertexLLM):
|
|||
)
|
||||
return open_ai_response
|
||||
|
||||
async def pass_through_vertex_ai_fine_tuning_job(
|
||||
async def pass_through_vertex_ai_POST_request(
|
||||
self,
|
||||
request_data: dict,
|
||||
vertex_project: str,
|
||||
vertex_location: str,
|
||||
vertex_credentials: str,
|
||||
request_route: str,
|
||||
):
|
||||
auth_header, _ = self._get_token_and_url(
|
||||
model="",
|
||||
|
@ -264,14 +265,16 @@ class VertexFineTuningAPI(VertexLLM):
|
|||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
fine_tuning_url = f"https://{vertex_location}-aiplatform.googleapis.com/v1/projects/{vertex_project}/locations/{vertex_location}/tuningJobs"
|
||||
url = None
|
||||
if request_route == "tuningJobs":
|
||||
url = f"https://{vertex_location}-aiplatform.googleapis.com/v1/projects/{vertex_project}/locations/{vertex_location}/tuningJobs"
|
||||
|
||||
if self.async_handler is None:
|
||||
raise ValueError("VertexAI Fine Tuning - async_handler is not initialized")
|
||||
|
||||
response = await self.async_handler.post(
|
||||
headers=headers,
|
||||
url=fine_tuning_url,
|
||||
url=url,
|
||||
json=request_data, # type: ignore
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue