{"openapi":"3.0.0","info":{"title":"pryon/api/ext/generative/v1alpha1/generative.proto","version":"version not set"},"paths":{"/api/generative/v1alpha1/chat/completions":{"post":{"summary":"Chat Completions","description":"Generates a model response from a list of messages comprising a conversation.","operationId":"Generative_CreateChatCompletions","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1alpha1ChatCompletionsResponse"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1alpha1ChatCompletionsRequest"}}},"required":true},"tags":["Generative"]}},"/api/generative/v1alpha1/tasks/complete-query":{"post":{"summary":"Pryon Query Rewrite","description":"Generates a completed query by replacing references to entities or information in prior turns of the conversation.","operationId":"Generative_CompleteQuery","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1alpha1CompleteQueryResponse"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1alpha1CompleteQueryRequest"}}},"required":true},"tags":["Generative"]}},"/api/generative/v1alpha1/tasks/route-query":{"post":{"summary":"Pryon Query Routing","description":"Return query out-of-domain classifications.","operationId":"Generative_RouteQuery","responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1alpha1RouteQueryResponse"}}}},"default":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rpcStatus"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1alpha1RouteQueryRequest"}}},"required":true},"tags":["Generative"]}}},"components":{"schemas":{"protobufAny":{"type":"object","properties":{"type_url":{"type":"string"},"value":{"type":"string","format":"byte"}}},"rpcStatus":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/protobufAny"}}}},"v1alpha1ChatCompletionsRequest":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/v1alpha1Message"},"description":"List of messages that form the conversation."},"model":{"type":"string","description":"ID of the model to use, in / format, for example, pryon/pryon-zeus-1, openai/gpt-4o, or openai/o1-mini."},"temperature":{"type":"number","format":"float","description":"Sampling temperature; the range depends on the product and model being called; higher values, for example, 0.8, make the output more random, while lower values, for example, 0.2, make the output more focused and deterministic; it is recommended that you adjust this value or top_p, but not both."},"top_p":{"type":"number","format":"float","description":"Alternative to sampling with temperature, that is, nucleus sampling; the model considers the results of the tokens with top_p probability mass, for example, 0.1 means tokens comprising the top 10% probability mass are considered."},"stream":{"type":"boolean","description":"If set to true, the model response data is streamed to the client as it is generated using server-sent events."},"stop":{"type":"array","items":{"type":"string"},"description":"Stop sequences to signal the API to generating."},"max_completion_tokens":{"type":"integer","format":"int32","description":"Maximum number of tokens generated in the chat completion; can be used to control costs for text generated via API."},"logprobs":{"type":"boolean","description":"True returns the log probabilities of each output token present in the content of message; False does not return probabilities."},"top_logprobs":{"type":"integer","format":"int32","description":"Number from 0 to 20 which specifies the number of most likely tokens and associated log probabilities to return at each token position; must be set to True to return this information."}}},"v1alpha1ChatCompletionsResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the chat completion"},"choices":{"type":"array","items":{"$ref":"#/components/schemas/v1alpha1Choice"},"description":"List chat completion choices."},"created":{"type":"string","format":"int64","description":"Creation timestamp (in seconds) for the chat completion."},"model":{"type":"string","description":"Model used for chat completion."},"object":{"type":"string","description":"Object type; choices are chat.completion or chat.completion.chunk."},"usage":{"$ref":"#/components/schemas/v1alpha1Usage"}},"title":"Response for chat completion\nnon-streaming: https://platform.openai.com/docs/api-reference/chat/object\nstreaming: https://platform.openai.com/docs/api-reference/chat/streaming"},"v1alpha1Choice":{"type":"object","properties":{"index":{"type":"integer","format":"int32","description":"Index of the choice."},"message":{"$ref":"#/components/schemas/v1alpha1Message"},"delta":{"$ref":"#/components/schemas/v1alpha1Delta"},"logprobs":{"type":"array","items":{"$ref":"#/components/schemas/v1alpha1LogProbs"},"description":"Log probability information for the choice."},"finish_reason":{"type":"string","description":"Detailed explanation of the completion process."}},"title":"Individual completion choice"},"v1alpha1CompleteQueryRequest":{"type":"object","properties":{"query":{"type":"string","description":"Query to complete given context."},"conversation_context":{"type":"string","description":"Context for prior turns in the conversation."},"conversation_id":{"type":"string","description":"Retrieve context history (question-answer pairs) from previous exchanges in the conversation."}}},"v1alpha1CompleteQueryResponse":{"type":"object","properties":{"completed_query":{"type":"string","description":"Full text of the rewritten query."}}},"v1alpha1Delta":{"type":"object","properties":{"role":{"type":"string","description":"Role of the message sender, that is, system, user, or assistant."},"content":{"type":"string","description":"Content that has changes in the message."}},"title":"Change in a streaming message"},"v1alpha1LogProbToken":{"type":"object","properties":{"token":{"type":"string","description":"The token returned."},"logprob":{"type":"number","format":"float","description":"Log probability for the token; displays position if within the top 20 most likely tokens or -9999.0 to signify an unlikely token."},"bytes":{"type":"array","items":{"type":"integer","format":"int32"},"description":"The UTF-8 bytes representation of the token; null if there is no byte representation; deliniates between multiple tokens when byte representations are combined to generate text representation."}}},"v1alpha1LogProbTokenWithTop":{"type":"object","properties":{"token":{"type":"string","description":"The token returned."},"logprob":{"type":"number","format":"float","description":"Log probability for the token; displays position if within the top 20 most likely tokens or -9999.0 to signify an unlikely token."},"bytes":{"type":"array","items":{"type":"integer","format":"int32"},"description":"The UTF-8 bytes representation of the token; null if there is no byte representation; deliniates between multiple tokens when byte representations are combined to generate text representation."},"top_logprobs":{"type":"array","items":{"$ref":"#/components/schemas/v1alpha1LogProbToken"},"description":"List of the most likely tokens and their log probability for the token position; may be fewer than the number of requested top_logprobs returned."}}},"v1alpha1LogProbs":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/v1alpha1LogProbTokenWithTop"},"description":"List of message content tokens with log probability information."},"refusal":{"type":"array","items":{"$ref":"#/components/schemas/v1alpha1LogProbTokenWithTop"},"description":"List of message refusal tokens with log probability information."}}},"v1alpha1Message":{"type":"object","properties":{"role":{"type":"string","description":"Role of the message sender, that is, system, user, or assistant."},"content":{"type":"string","description":"Content of the message."}},"title":"Individual message in the conversation"},"v1alpha1RouteQueryRequest":{"type":"object","properties":{"query":{"type":"string","description":"Query string."},"domain":{"type":"string","description":"Defaults to the company receiving support; can be modified to define any domain."},"enable_generative_conversational_response":{"type":"boolean","description":"Whether conversational responses are generated or canned."}}},"v1alpha1RouteQueryResponse":{"type":"object","properties":{"is_intelligible":{"type":"boolean","description":"Whether the given query is intelligible."},"is_english":{"type":"boolean","description":"Whether the given query is in a supported language."},"is_conversational":{"type":"boolean","description":"Whether the given query is conversational."},"conversational_response":{"type":"string","description":"The LLM-generated response to a conversational query."}}},"v1alpha1Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","format":"int32","description":"Tokens in the prompt."},"completion_tokens":{"type":"integer","format":"int32","description":"Tokens in the completion."},"total_tokens":{"type":"integer","format":"int32","description":"Total tokens used."}},"title":"Usage statistics\nTODO: if we're going out to reasoning models,\ndo we need to include those tokens separately?"}}}}