SwiftstructTokenGenerationCore
struct TokenGenerationCore.Grammar
Structure
What a query’s scopes step through. Every node here can be matched — see the syntax.
inherits{}
- protocolSwift.CustomStringConvertible
- protocolSwift.Equatable
- protocolSwift.Hashable
Members 24
- func
static anyText(thoughtBudget: PromptKit.ThoughtBudget, version: TokenGenerationCore.PromptPreprocessingTemplateVersion?) throws -> TokenGenerationCore.Grammar - func
static appendingUnusedThoughtRules(to: TokenGenerationCore.Grammar, version: TokenGenerationCore.PromptPreprocessingTemplateVersion) -> TokenGenerationCore.Grammar - func
static combiningWithAlternation(TokenGenerationCore.Grammar, TokenGenerationCore.Grammar) throws -> TokenGenerationCore.Grammar - func
static combiningWithMixedResponse(toolGrammar: TokenGenerationCore.Grammar, outputGrammar: TokenGenerationCore.Grammar) throws -> TokenGenerationCore.Grammar - func
static freeformText() throws -> TokenGenerationCore.Grammar - func
static parsedRules(backusNaurForm: String) throws -> [TokenGenerationCore.Rule] - func
static prependingThoughtGrammar(to: TokenGenerationCore.Grammar, version: TokenGenerationCore.PromptPreprocessingTemplateVersion) -> TokenGenerationCore.Grammar - func
static regexRules(pattern: String, wrapInQuotes: Bool) throws -> [TokenGenerationCore.Rule] - field
let cacheableResursiveNonTerminals: [String]+0x0 - field
let characterSetsUsedInGrammar: [Foundation.CharacterSet]+0x28 - field
let root: TokenGenerationCore.Rule+0x8 - field
let rules: [TokenGenerationCore.Rule]+0x20 - func
prefixingRules(with: String) throws -> TokenGenerationCore.Grammar - init
init(backusNaurForm: String, prependSpaceToRootRule: Bool, cacheableResursiveNonTerminals: [String], allowSpecialTokensIDTerminals: Bool) throws -> TokenGenerationCore.Grammar - init
init(backusNaurForm: String, prependSpaceToRootRule: Bool) throws -> TokenGenerationCore.Grammar - init
init(toolsDefinitions: [GenerativeFunctionsFoundation.ToolDefinition], version: TokenGenerationCore.PromptPreprocessingTemplateVersion) throws -> TokenGenerationCore.Grammar - init
init(rules: [TokenGenerationCore.Rule], prependSpaceToRootRule: Bool, cacheableResursiveNonTerminals: [String]) throws -> TokenGenerationCore.Grammar - init
init(rules: [TokenGenerationCore.Rule], prependSpaceToRootRule: Bool) throws -> TokenGenerationCore.Grammar - init
init(tools: [GenerativeFunctionsFoundation.Tool.Function], version: TokenGenerationCore.PromptPreprocessingTemplateVersion) throws -> TokenGenerationCore.Grammar - init
init(schema: GenerativeFunctionsFoundation.Schema) -> TokenGenerationCore.Grammar - init
init(_: GenerativeFunctionsFoundation.Schema, jsonObjectFormat: TokenGenerationCore.JSONObjectFormat) throws -> TokenGenerationCore.Grammar - init
init(_: GenerativeFunctionsFoundation.Schema, compact: Bool) throws -> TokenGenerationCore.Grammar - init
init(GenerativeFunctionsFoundation.Schema) throws -> TokenGenerationCore.Grammar - var
var description: String { get }
Header
struct Grammar { let cacheableResursiveNonTerminals: [Swift.String] let root: TokenGenerationCore.Rule let rules: [TokenGenerationCore.Rule] let characterSetsUsedInGrammar: [Foundation.CharacterSet] init(backusNaurForm: Swift.String, prependSpaceToRootRule: Swift.Bool, cacheableResursiveNonTerminals: [Swift.String], allowSpecialTokensIDTerminals: Swift.Bool) throws init(backusNaurForm: Swift.String, prependSpaceToRootRule: Swift.Bool) throws init(toolsDefinitions: [GenerativeFunctionsFoundation.ToolDefinition], version: TokenGenerationCore.PromptPreprocessingTemplateVersion) throws init(rules: [TokenGenerationCore.Rule], prependSpaceToRootRule: Swift.Bool, cacheableResursiveNonTerminals: [Swift.String]) throws init(rules: [TokenGenerationCore.Rule], prependSpaceToRootRule: Swift.Bool) throws init(tools: [GenerativeFunctionsFoundation.Tool.Function], version: TokenGenerationCore.PromptPreprocessingTemplateVersion) throws init(schema: GenerativeFunctionsFoundation.Schema) init(_: GenerativeFunctionsFoundation.Schema, jsonObjectFormat: TokenGenerationCore.JSONObjectFormat) throws init(_: GenerativeFunctionsFoundation.Schema, compact: Swift.Bool) throws init(_: GenerativeFunctionsFoundation.Schema) throws var description: Swift.String { get } func prefixingRules(with: Swift.String) throws -> TokenGenerationCore.Grammar static func prependingThoughtGrammar(to: TokenGenerationCore.Grammar, version: TokenGenerationCore.PromptPreprocessingTemplateVersion) -> TokenGenerationCore.Grammar static func regexRules(pattern: Swift.String, wrapInQuotes: Swift.Bool) throws -> [TokenGenerationCore.Rule] static func parsedRules(backusNaurForm: Swift.String) throws -> [TokenGenerationCore.Rule] static func freeformText() throws -> TokenGenerationCore.Grammar static func combiningWithAlternation(_: TokenGenerationCore.Grammar, _: TokenGenerationCore.Grammar) throws -> TokenGenerationCore.Grammar static func combiningWithMixedResponse(toolGrammar: TokenGenerationCore.Grammar, outputGrammar: TokenGenerationCore.Grammar) throws -> TokenGenerationCore.Grammar static func appendingUnusedThoughtRules(to: TokenGenerationCore.Grammar, version: TokenGenerationCore.PromptPreprocessingTemplateVersion) -> TokenGenerationCore.Grammar static func anyText(thoughtBudget: PromptKit.ThoughtBudget, version: TokenGenerationCore.PromptPreprocessingTemplateVersion?) throws -> TokenGenerationCore.Grammar }