@@ -69,33 +69,6 @@ async def show_model(request: Request):
6969 )
7070 return response .json ()
7171
72- @self .router .get (f"/{ self .provider_route_name } /api/tags" )
73- async def get_tags (request : Request ):
74- """
75- Special route for /api/tags that responds outside of the pipeline
76- Tags are used to get the list of models
77- https://github.com/ollama/ollama/blob/main/docs/api.md#list-local-models
78- """
79- async with httpx .AsyncClient () as client :
80- response = await client .get (f"{ self .base_url } /api/tags" )
81- return response .json ()
82-
83- @self .router .post (f"/{ self .provider_route_name } /api/show" )
84- async def show_model (request : Request ):
85- """
86- route for /api/show that responds outside of the pipeline
87- /api/show displays model is used to get the model information
88- https://github.com/ollama/ollama/blob/main/docs/api.md#show-model-information
89- """
90- body = await request .body ()
91- async with httpx .AsyncClient () as client :
92- response = await client .post (
93- f"{ self .base_url } /api/show" ,
94- content = body ,
95- headers = {"Content-Type" : "application/json" },
96- )
97- return response .json ()
98-
9972 # Native Ollama API routes
10073 @self .router .post (f"/{ self .provider_route_name } /api/chat" )
10174 @self .router .post (f"/{ self .provider_route_name } /api/generate" )
@@ -114,6 +87,7 @@ async def create_completion(request: Request):
11487
11588 is_fim_request = self ._is_fim_request (request , data )
11689 try :
90+ print ("i create completion with data" , data )
11791 stream = await self .complete (data , api_key = None , is_fim_request = is_fim_request )
11892 except httpx .ConnectError as e :
11993 logger = structlog .get_logger ("codegate" )
@@ -129,4 +103,6 @@ async def create_completion(request: Request):
129103 else :
130104 # just continue raising the exception
131105 raise e
106+ print ("result is" )
107+ print (self ._completion_handler .create_response (stream ))
132108 return self ._completion_handler .create_response (stream )
0 commit comments