Well, this is still not working, though I did notice that my OpenAPI spec was missing some description details. Here’s the new version:
{
"openapi": "3.0.2",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"paths": {
"/search/entity/{term}": {
"get": {
"summary": "Search for entities in the Monarch knowledge graph",
"description": "Search for entities in the Monarch knowledge graph",
"operationId": "search_entity",
"parameters": [
{
"description": "The ontology term to search for.",
"required": true,
"schema": {
"title": "Term",
"type": "string",
"description": "The ontology term to search for."
},
"name": "term",
"in": "path"
},
{
"description": "The category to search within.",
"required": false,
"schema": {
"title": "Category",
"type": "array",
"items": {
"type": "string"
},
"description": "The category to search within.",
"default": [
"disease"
]
},
"name": "category",
"in": "query"
},
{
"description": "The maximum number of search results to return.",
"required": false,
"schema": {
"title": "Rows",
"type": "integer",
"description": "The maximum number of search results to return.",
"default": 2
},
"name": "rows",
"in": "query"
}
],
"responses": {
"200": {
"description": "Search results for the given ontology term",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchResultResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/bioentity/disease/{id}/phenotypes": {
"get": {
"summary": "Get phenotypes associated with disease",
"description": "Get phenotypes associated with disease",
"operationId": "get_disease_phenotype_associations",
"parameters": [
{
"required": true,
"schema": {
"title": "Id",
"type": "string"
},
"name": "id",
"in": "path"
},
{
"required": false,
"schema": {
"title": "Rows",
"type": "integer",
"default": 10
},
"name": "rows",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Unselect Evidence",
"type": "boolean",
"default": true
},
"name": "unselect_evidence",
"in": "query"
}
],
"responses": {
"200": {
"description": "Phenotypes associated with disease",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PhenotypeAssociationResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/bioentity/disease/{id}/genes": {
"get": {
"summary": "Get gene information for a disease",
"description": "Get gene information for a disease",
"operationId": "get_disease_gene_associations",
"parameters": [
{
"description": "The ontology identifier of the disease.",
"required": true,
"schema": {
"title": "Id",
"type": "string",
"description": "The ontology identifier of the disease."
},
"name": "id",
"in": "path"
},
{
"description": "The maximum number of results to return.",
"required": false,
"schema": {
"title": "Max Results",
"type": "integer",
"description": "The maximum number of results to return.",
"default": 10
},
"name": "max_results",
"in": "query"
},
{
"description": "The type of association to return.",
"required": false,
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/AssociationType"
}
],
"description": "The type of association to return.",
"default": "causal"
},
"name": "association_type",
"in": "query"
}
],
"responses": {
"200": {
"description": "Gene information for a disease",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GeneInfoResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/bioentity/gene/{id}/phenotypes": {
"get": {
"summary": "Get phenotypes associated with gene",
"description": "Get phenotypes associated with gene",
"operationId": "get_gene_phenotype_associations",
"parameters": [
{
"required": true,
"schema": {
"title": "Id",
"type": "string"
},
"name": "id",
"in": "path"
},
{
"required": false,
"schema": {
"title": "Rows",
"type": "integer",
"default": 4
},
"name": "rows",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Facet",
"type": "boolean",
"default": false
},
"name": "facet",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Unselect Evidence",
"type": "boolean",
"default": true
},
"name": "unselect_evidence",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Exclude Automatic Assertions",
"type": "boolean",
"default": false
},
"name": "exclude_automatic_assertions",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Fetch Objects",
"type": "boolean",
"default": false
},
"name": "fetch_objects",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Use Compact Associations",
"type": "boolean",
"default": true
},
"name": "use_compact_associations",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Direct",
"type": "boolean",
"default": false
},
"name": "direct",
"in": "query"
},
{
"required": false,
"schema": {
"title": "Direct Taxon",
"type": "boolean",
"default": false
},
"name": "direct_taxon",
"in": "query"
}
],
"responses": {
"200": {
"description": "Phenotypes associated with gene",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenePhenotypeAssociationResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"AssociationType": {
"title": "AssociationType",
"enum": [
"causal",
"non_causal",
"both"
],
"type": "string",
"description": "An enumeration."
},
"GeneInfo": {
"title": "GeneInfo",
"required": [
"gene_id",
"gene_label",
"relation_label"
],
"type": "object",
"properties": {
"gene_id": {
"title": "Gene Id",
"type": "string",
"description": "The ontology identifier of the gene."
},
"gene_label": {
"title": "Gene Label",
"type": "string",
"description": "The human-readable label of the gene."
},
"relation_label": {
"title": "Relation Label",
"type": "string",
"description": "The human-readable label of the relation between the gene and the disease."
}
}
},
"GeneInfoResponse": {
"title": "GeneInfoResponse",
"required": [
"genes"
],
"type": "object",
"properties": {
"genes": {
"title": "Genes",
"type": "array",
"items": {
"$ref": "#/components/schemas/GeneInfo"
},
"description": "The list of genes associated with the disease."
}
}
},
"GenePhenotypeAssociation": {
"title": "GenePhenotypeAssociation",
"required": [
"subject",
"relation",
"objects"
],
"type": "object",
"properties": {
"subject": {
"title": "Subject",
"type": "string",
"description": "The gene identifier."
},
"relation": {
"title": "Relation",
"type": "string",
"description": "The ontology identifier of the relation."
},
"objects": {
"title": "Objects",
"type": "array",
"items": {
"type": "string"
},
"description": "A list of phenotype ontology identifiers associated with the gene."
}
}
},
"GenePhenotypeAssociationResponse": {
"title": "GenePhenotypeAssociationResponse",
"required": [
"compact_associations",
"numFound"
],
"type": "object",
"properties": {
"compact_associations": {
"title": "Compact Associations",
"type": "array",
"items": {
"$ref": "#/components/schemas/GenePhenotypeAssociation"
}
},
"numFound": {
"title": "Numfound",
"type": "integer"
}
}
},
"HTTPValidationError": {
"title": "HTTPValidationError",
"type": "object",
"properties": {
"detail": {
"title": "Detail",
"type": "array",
"items": {
"$ref": "#/components/schemas/ValidationError"
}
}
}
},
"Phenotype": {
"title": "Phenotype",
"required": [
"id",
"label"
],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The ontology identifier of the phenotype."
},
"label": {
"title": "Label",
"type": "string",
"description": "The human-readable label of the phenotype."
}
}
},
"PhenotypeAssociation": {
"title": "PhenotypeAssociation",
"required": [
"id",
"frequency",
"onset",
"phenotype"
],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"frequency": {
"title": "Frequency",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"onset": {
"title": "Onset",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"phenotype": {
"$ref": "#/components/schemas/Phenotype"
}
}
},
"PhenotypeAssociationResponse": {
"title": "PhenotypeAssociationResponse",
"required": [
"associations",
"numFound"
],
"type": "object",
"properties": {
"associations": {
"title": "Associations",
"type": "array",
"items": {
"$ref": "#/components/schemas/PhenotypeAssociation"
}
},
"numFound": {
"title": "Numfound",
"type": "integer"
}
}
},
"SearchResultItem": {
"title": "SearchResultItem",
"required": [
"id",
"synonyms"
],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The ontology identifier of the search result."
},
"synonyms": {
"title": "Synonyms",
"type": "array",
"items": {
"type": "string"
},
"description": "The list of synonyms for the search result."
}
}
},
"SearchResultResponse": {
"title": "SearchResultResponse",
"required": [
"results"
],
"type": "object",
"properties": {
"results": {
"title": "Results",
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchResultItem"
},
"description": "The list of search results."
}
}
},
"ValidationError": {
"title": "ValidationError",
"required": [
"loc",
"msg",
"type"
],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
}
},
"msg": {
"title": "Message",
"type": "string"
},
"type": {
"title": "Error Type",
"type": "string"
}
}
}
}
}
}
Here’s the “ChatGPT Prompt” info from the Plugin devtools sidebar:
// Plugin for searching for genes related to diseases. You can search for diseases and genes and get a list of related genes. If a call to the plugin fails, do not continue, just report the error to the user.
namespace monarch {
// Search for entities in the Monarch knowledge graph
type search_entity = (_: {
// The ontology term to search for.
term: string,
// The category to search within.
category?: string[],
// The maximum number of search results to return.
rows?: number,
}) => any;
// Get phenotypes associated with disease
type get_disease_phenotype_associations = (_: {
id: string,
rows?: number,
unselect_evidence?: boolean,
}) => any;
// Get gene information for a disease
type get_disease_gene_associations = (_: {
// The ontology identifier of the disease.
id: string,
// The maximum number of results to return.
max_results?: number,
// The type of association to return.
association_type?: "causal" | "non_causal" | "both",
}) => any;
// Get phenotypes associated with gene
type get_gene_phenotype_associations = (_: {
id: string,
rows?: number,
facet?: boolean,
unselect_evidence?: boolean,
exclude_automatic_assertions?: boolean,
fetch_objects?: boolean,
use_compact_associations?: boolean,
direct?: boolean,
direct_taxon?: boolean,
}) => any;
} // namespace monarch
When I ask the model about the error I get:
The error I received while attempting to retrieve information about the genes involved in Marfan syndrome was a "501" error. This error code typically indicates that the server does not support the functionality required to fulfill the request. In this case, it suggests that there was an issue with the plugin that prevented it from successfully completing the request to retrieve gene information for Marfan syndrome.
Unfortunately, I do not have additional details about the specific cause of the error. However, it is possible that there was a temporary issue with the plugin or the underlying service it relies on. If you would like to try again later, we may be able to retrieve the information successfully.
Then I asked it I don't see any 501 return in either my browser logs or the server logs. What is the endpoint you are trying to reach and what data are you trying to send? and got this response:
As an AI language model, I do not have direct access to external servers, browser logs, or server logs. Instead, I communicate with external services through plugins that are integrated into the platform on which I am running. In this case, I am using the "monarch" plugin to access information from the Monarch Initiative's knowledge graph.
When you asked about the genes involved in Marfan syndrome, I used the "search_entity" function of the "monarch" plugin to search for the disease term "Marfan syndrome." After obtaining the ontology identifier for Marfan syndrome (MONDO:0007947), I used the "get_disease_gene_associations" function of the plugin to request information about genes associated with Marfan syndrome. Specifically, I requested information about causally associated genes.
The error message I received indicated a "501" error, which typically means that the server does not support the functionality required to fulfill the request. However, since you mentioned that you do not see any 501 return in your logs, it's possible that the error message was not accurate or that there was a miscommunication between the plugin and the external service.
This looks similar to an error reported here: 501 Error developing plug