mirror of
https://github.com/katanemo/plano.git
synced 2026-05-02 04:12:56 +02:00
Added Float type to the function parameter values (#77)
This commit is contained in:
parent
7505a0fc1f
commit
7f0fcb372b
26 changed files with 1505 additions and 45 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
from fastapi import FastAPI, Response
|
||||
from bolt_handler import BoltHandler
|
||||
from arch_handler import ArchHandler
|
||||
from common import ChatMessage
|
||||
import logging
|
||||
from openai import OpenAI
|
||||
|
|
@ -14,7 +15,8 @@ logger.info(f"using model: {ollama_model}")
|
|||
logger.info(f"using ollama endpoint: {ollama_endpoint}")
|
||||
|
||||
app = FastAPI()
|
||||
handler = BoltHandler()
|
||||
bolt_handler = BoltHandler()
|
||||
arch_handler = ArchHandler()
|
||||
|
||||
client = OpenAI(
|
||||
base_url='http://{}:11434/v1/'.format(ollama_endpoint),
|
||||
|
|
@ -33,6 +35,10 @@ async def healthz():
|
|||
@app.post("/v1/chat/completions")
|
||||
async def chat_completion(req: ChatMessage, res: Response):
|
||||
logger.info("starting request")
|
||||
if ollama_model.startswith("Bolt"):
|
||||
handler = bolt_handler
|
||||
else:
|
||||
handler = arch_handler
|
||||
tools_encoded = handler._format_system(req.tools)
|
||||
# append system prompt with tools to messages
|
||||
messages = [{"role": "system", "content": tools_encoded}]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue