Parameters
These are the parameters for OpenAI. Please set the authentication parameters for other models as appropriate from the function definitions above.string
required
Prompt
string
required
API key to use the LLM model
string
LLM model to use
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
morph_lib.ai package has been deprecated since v0.1.5 to reduce the size of the morph-data package.It is planned to be provided in the form of an external adapter in the future.# 📦 Package: morph_lib.ai.openai.code_generation
# 🛠️ Function: text_to_html
def text_to_html(
prompt: str,
api_key: str,
model: Optional[str] = "gpt-4o",
) -> TextConversionResponse:
# 📦 Package: morph_lib.ai.anthropic.code_generation
# 🛠️ Function: text_to_html
def text_to_html(
prompt: str,
api_key: str,
model: Optional[str] = "claude-3-5-haiku-latest",
max_tokens: Optional[int] = 1024,
) -> TextConversionResponse:
# 📦 Package: morph_lib.ai.azure.code_generation
# 🛠️ Function: text_to_html
def text_to_html(
prompt: str,
api_key: str,
azure_endpoint: str,
deployment_name: Optional[str] = "gpt4",
api_version: Optional[str] = "2024-10-01-preview",
) -> TextConversionResponse:
# 📦 Package: morph_lib.ai.groq.code_generation
# 🛠️ Function: text_to_html
def text_to_html(
prompt: str,
api_key: str,
model: Optional[str] = "llama-3.1-70b-versatile",
) -> TextConversionResponse:
from morph_lib.ai.openai.code_generation import text_to_html
import os
@morph.func
def func_name(context):
prompt = context.vars["prompt"]
fig = text_to_html(
prompt,
os.environ["OPENAI_API_KEY"],
"gpt-4o",
)
code = fig.code
print(code)
return fig.content