Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit c8bc5ec

Browse files
lukehindsyrobla
authored andcommitted
Remove list check
1 parent 502c5b0 commit c8bc5ec

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/codegate/pipeline/secrets/signatures.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,6 @@ def find_in_string(cls, text: Union[str, List[str]]) -> List[Match]:
223223
if not cls._yaml_path:
224224
raise RuntimeError("SecretFinder not initialized.")
225225

226-
# Convert list to string if necessary (needed for Cline, which sends a list of strings)
227-
if isinstance(text, list):
228-
text = "\n".join(str(line) for line in text)
229-
230226
matches = []
231227

232228
# Split text into lines for processing

src/codegate/providers/ollama/provider.py

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)