NousResearch / Hermes-Function-Calling

MIT License
475 stars 74 forks source link

pydantic_schema seems not passed to LLM in the first iteration #11

Closed Tuanshu closed 3 months ago

Tuanshu commented 3 months ago

in jsonmode.py,

pydantic_schema = Character.schema_json() ...

def generate_json_completion(self, query, chat_template, max_depth=5):
        try:
            depth = 0
            sys_prompt = "You are a helpful assistant that answers in JSON. Here's the json schema you must adhere to:\n<schema>\n{schema}\n<schema>"

if my understanding is correct, seem the pydantic_schema is not passed to {schema} here, is this supposed behavior?

interstellarninja commented 3 months ago

hi Tuanshu, thanks for pointing it out. It was a typo and now it's been fixed. https://github.com/NousResearch/Hermes-Function-Calling/commit/1ec8264cb5fc5b720d9ef4bd5c7b9f157487f894 we fine-tuned the model with pydantic schema as part of the system prompt so it'd be better to pas it in the system prompt.