Skip to content

Commit

Permalink
Make API URL customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin committed Mar 31, 2024
1 parent 5f0ce9c commit 39d2e44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ragna/assistants/_ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ def _make_system_content(self, sources: list[Source]) -> str:
return instruction + "\n\n".join(source.content for source in sources)

async def _call_api(
self, prompt: str, sources: list[Source], *, max_new_tokens: int
self,
prompt: str,
sources: list[Source],
*,
max_new_tokens: int,
api_url: str = "http://localhost:11434/api/chat",
) -> AsyncIterator[str]:
async with self._client.stream(
"POST",
"http://localhost:11434/api/chat", # TODO: Make this url customizable
api_url,
headers={
"Content-Type": "application/json",
},
Expand Down

0 comments on commit 39d2e44

Please sign in to comment.