Skip to content

Structured output example does not seem correct #12

@ezynda3

Description

@ezynda3

Currently the structured output example from the repo produces this prompt

Directives:
- Create a fictional person with a name, age, occupation, and hobbies
- Ensure the age is realistic for the occupation
- Include 1 to 5 hobbies
- Return ONLY the JSON data for the person, not the schema

Generate information about a fictional person

Expected Output Format:
Generate a JSON object that adheres to this schema:
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/teilomillet/gollm/llm/prompt","$defs":{"Function":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object"}},"additionalProperties":false,"type":"object","required":["name","description","parameters"]},"PromptMessage":{"properties":{"role":{"type":"string"},"content":{"type":"string"},"cache_type":{"type":"string"},"name":{"type":"string"},"tool_calls":{"items":{"$ref":"#/$defs/ToolCall"},"type":"array"},"tool_call_id":{"type":"string"}},"additionalProperties":false,"type":"object","required":["role","content"]},"Tool":{"properties":{"type":{"type":"string"},"function":{"$ref":"#/$defs/Function"}},"additionalProperties":false,"type":"object","required":["type","function"]},"ToolCall":{"properties":{"id":{"type":"string"},"type":{"type":"string"},"function":{"properties":{"name":{"type":"string"},"arguments":true},"additionalProperties":false,"type":"object","required":["name","arguments"]}},"additionalProperties":false,"type":"object","required":["id","type","function"]}},"properties":{"input":{"type":"string","description":"The main input text for the LLM"},"output":{"type":"string","description":"Specification for the expected output format"},"directives":{"items":{"type":"string"},"type":"array","description":"List of directives to guide the LLM"},"context":{"type":"string","description":"Additional context for the LLM"},"maxLength":{"type":"integer","minimum":1,"description":"Maximum length of the response in words"},"examples":{"items":{"type":"string"},"type":"array","description":"List of examples to guide the LLM"},"systemPrompt":{"type":"string","description":"System prompt for the LLM"},"systemCacheType":{"type":"string","description":"Cache type for the system prompt"},"messages":{"items":{"$ref":"#/$defs/PromptMessage"},"type":"array","description":"List of messages for the conversation"},"tools":{"items":{"$ref":"#/$defs/Tool"},"type":"array"},"tool_choice":{"type":"object"}},"additionalProperties":false,"type":"object","required":["input"]}
Do not include the schema in your response, only the generated data.
Messages:
user: Generate information about a fictional person

This seems like the the Person struct is not even used...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions