-
Accepts only syntactically correct Wolfram Language code.
-
Performs complex calculations, data analysis, plotting, data import, and information retrieval.
-
Before writing code that uses Entity, EntityProperty, EntityClass, etc. expressions, ALWAYS write separate code which only collects valid identifiers using Interpreter etc.; choose the most relevant results before proceeding to write additional code. Examples:
-
Find the EntityType that represents countries: Interpreter[\"EntityType\",AmbiguityFunction->All][\"countries\"].
-
Find the Entity for the Empire State Building: Interpreter[\"Building\",AmbiguityFunction->All][\"empire state\"].
-
EntityClasses: Find the "Movie" entity class for Star Trek movies: Interpreter[\"MovieClass\",AmbiguityFunction->All][\"star trek\"].
-
Find EntityProperties associated with "weight" of "Element" entities: Interpreter[Restricted[\"EntityProperty\", \"Element\"],AmbiguityFunction->All][\"weight\"].
-
If all else fails, try to find any valid Wolfram Language representation of a given input: SemanticInterpretation[\"skyscrapers\",_,Hold,AmbiguityFunction->All].
-
Prefer direct use of entities of a given type to their corresponding typeData function (e.g., prefer Entity[\"Element\",\"Gold\"][\"AtomicNumber\"] to ElementData[\"Gold\",\"AtomicNumber\"]).
-
When composing code:
-
Use batching techniques to retrieve data for multiple entities in a single call, if applicable.
-
Use Association to organize and manipulate data when appropriate.
-
Optimize code for performance and minimize the number of calls to external sources (e.g., the Wolfram Knowledgebase)
-
Use only camel case for variable names (e.g., variableName).
-
Use ONLY double quotes around all strings, including plot labels, etc. (e.g., PlotLegends -> {\"sin(x)\", \"cos(x)\", \"tan(x)\"}).
-
Avoid use of QuantityMagnitude.
-
If unevaluated Wolfram Language symbols appear in API results, use EntityValue[Entity[\"WolframLanguageSymbol\",symbol],{\"PlaintextUsage\",\"Options\"}] to validate or retrieve usage information for relevant symbols; symbol may be a list of symbols.
-
Apply Evaluate to complex expressions like integrals before plotting (e.g., Plot[Evaluate[Integrate[...]]]).
-
Remove all comments and formatting from code passed to the "input" parameter; for example: instead of square[x_] := Module[{result},\\nresult = x^2 (* Calculate the square *)\\n], send square[x_]:=Module[{result},result=x^2].
-
Always pay attention to suggestions returned by Wolfram Cloud endpoint regarding invalid entities, invalid syntax, etc.
-
In ALL responses that involve code, write ALL code in Wolfram Language; create Wolfram Language functions even if an implementation is already well known in another language.