Describe the Bug
Model: Sonare-reasoning-pro
endpoint : ‘https://api.perplexity.ai/chat/completions’
error : {“error”:{“message”:“An internal server error has occurred.”,“type”:“internal_server_error”,“code”:500}}
Expected Behavior
The model was working before and returning proper pydantic format, now it fails with 500 status error and internal server error message
Actual Behavior
error : {“error”:{“message”:“An internal server error has occurred.”,“type”:“internal_server_error”,“code”:500}}
Steps to Reproduce
- Call the API with the following request:
- we have attached the request schema sent below in json format
{
"model": "sonar-reasoning-pro",
"messages": [
{
"role": "system",
"content": "You are a thorough financial analyst. Provide detailed, accurate information from reliable sources only. Do not speculate or make assumptions.Remove all citation numbers from the response."
},
{
"role": "user",
"content": "You are an intelligent assistant tasked with conducting a detailed company analysis based on available, factual, and verifiable information. Your output must follow a structured JSON format according to the specified Pydantic schema. Do not speculate or infer information that is not supported by reliable sources.\n\n Task:\n Conduct a comprehensive analysis of Company : 73 strings , Compnay Website URL : https://www.73strings.com/. Output the results strictly in JSON format following the structure and field types below."
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"schema": {
"$defs": {
"FundingRound": {
"properties": {
"round_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of funding round (e.g., Seed, Series A, Series B).",
"title": "Round Type"
},
"funding_date": {
"anyOf": [
{
"format": "date",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Date of the funding round was announced or closed.Date should be in strict format YYYY-MM-DD. convert the date to YYYY-MM-DD format if it doesnt follow the format.The date must always be complete and follow ISO format. If the Date is in form of Range Pick the Right End of the Date RageIf the input only contains year and month (e.g., 'April 2005'), default the day to '01'. If the input only contains year (e.g., '2000'), default both month and day to '01'. If the year is missing or cannot be inferred, set the value to null.",
"title": "Funding Date"
},
"amount": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Funding amount raised (e.g., '$55M').",
"title": "Amount"
},
"valuation_post_money": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Post-money valuation after this round, if known.",
"title": "Valuation Post Money"
},
"lead_investors": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "List of lead investors in the round.",
"title": "Lead Investors"
},
"participating_investors": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Other investors involved in the round.",
"title": "Participating Investors"
},
"notes": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Any additional comments or special context for this round.",
"title": "Notes"
}
},
"title": "FundingRound",
"type": "object"
}
},
"properties": {
"total_funding": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Cumulative funding amount raised to date.",
"title": "Total Funding"
},
"revenue_details": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Range or estimate of current annual revenue.",
"title": "Revenue Details"
},
"revenue_model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Revenue generation model, e.g., subscriptions, licensing.",
"title": "Revenue Model"
},
"profitability_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Profitability of the company (e.g., profitable, loss-making).",
"title": "Profitability Status"
},
"ebitda": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Reported EBITDA, if available.",
"title": "Ebitda"
},
"funding_rounds": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/FundingRound"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Detailed list of all funding rounds.",
"title": "Funding Rounds"
},
"key_investors": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Notable investors in any stage.",
"title": "Key Investors"
},
"funding_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Summary of latest funding status or trajectory.",
"title": "Funding Status"
},
"current_valuation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Estimated current company valuation.",
"title": "Current Valuation"
},
"growth_metrics": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Summary of company growth (e.g., customer base, AUM, revenue).",
"title": "Growth Metrics"
},
"financial_sources": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Sources from which financial information was derived.",
"title": "Financial Sources"
},
"additional_context": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Any additional financial-related notes or edge cases.",
"title": "Additional Context"
}
},
"title": "Financials",
"type": "object"
}
}
}
}
- Observe the unexpected behavior.
API Request & Response (if applicable)
Environment
- API Version: [e.g., sonar-3.1]
- SDK (if applicable): [e.g., Python SDK v0.5]
- Operating System: [e.g., MacOS, Linux, Windows]
Logs or Screenshots (if applicable)
Add any logs or screenshots that can help debug the issue.
Additional Context
Add any other context about the problem here.