Endpoint Examples
Generate Text
Endpoint Examples
Generate Text
generate natural language responses using open source language models
Request Body
-
messages
(JSON): Array of messages. -
model
(text): Identifier of language model to use (e.g., “llama-3.3-70b”)
Response
The response is a JSON object with the following properties:
-
response
: Conversational response to the query. -
tokens
: The number of tokens. -
success
: Indicates the success status of the request.
POST
/
v1
/
text-generation
curl --request POST \
--url https://api.wetrocloud.com/v1/text-generation/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'messages=[
{
"role": "user",
"content": "what is a large language model?"
}
]' \
--form model=llama-3.3-70b
{
"response": "A large language model is a type of artificial intelligence (AI) designed to process and understand human language. It's a computer program that uses complex algorithms and statistical models to analyze and generate text, often at a scale and sophistication that rivals human language abilities.\n\nLarge language models are typically trained on vast amounts of text data, which can include books, articles, research papers, websites, and more. This training data allows the model to learn patterns, relationships, and structures within language, enabling it to:\n\n1. **Understand context**: Recognize the meaning of words, phrases, and sentences within a given context.\n2. **Generate text**: Produce coherent and natural-sounding text based on a prompt, topic, or style.\n3. **Translate language**: Convert text from one language to another.\n4. **Summarize content**: Distill long pieces of text into concise summaries.\n5. **Answer questions**: Respond to questions and provide relevant information.\n6. **Chat and converse**: Engage in natural-sounding conversations, using context and understanding to respond to questions and statements.\n\nSome key characteristics of large language models include:\n\n* **Scale**: They are trained on massive datasets, often containing billions of words or more.\n* **Depth**: They have many layers of neural networks, which allow them to capture complex patterns and relationships in language.\n* **Generative capabilities**: They can generate text that is often indistinguishable from human-written content.\n\nExamples of large language models include:\n\n* Transformer models (e.g., BERT, RoBERTa)\n* Recurrent neural network (RNN) models (e.g., LSTM, GRU)\n* Generative adversarial network (GAN) models\n\nLarge language models have many applications, such as:\n\n* **Virtual assistants**: Powering chatbots, voice assistants, and other conversational interfaces.\n* **Language translation**: Enabling accurate and efficient translation of text and speech.\n* **Text generation**: Automating content creation, such as articles, social media posts, and product descriptions.\n* **Sentiment analysis**: Analyzing text to determine sentiment, emotion, and opinion.\n\nHowever, large language models also raise important questions and concerns, such as:\n\n* **Bias and fairness**: How do we ensure that these models are fair, transparent, and free from bias?\n* **Explainability**: How can we understand and interpret the decisions made by these complex models?\n* **Security**: How can we protect against potential misuse or manipulation of these powerful models?\n\nI hope this helps! Do you have any specific questions or topics related to large language models that you'd like me to expand on?",
"tokens": 1746,
"success": true
}
Authorizations
Response
200
application/json
OK
The response is of type object
.
curl --request POST \
--url https://api.wetrocloud.com/v1/text-generation/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'messages=[
{
"role": "user",
"content": "what is a large language model?"
}
]' \
--form model=llama-3.3-70b
{
"response": "A large language model is a type of artificial intelligence (AI) designed to process and understand human language. It's a computer program that uses complex algorithms and statistical models to analyze and generate text, often at a scale and sophistication that rivals human language abilities.\n\nLarge language models are typically trained on vast amounts of text data, which can include books, articles, research papers, websites, and more. This training data allows the model to learn patterns, relationships, and structures within language, enabling it to:\n\n1. **Understand context**: Recognize the meaning of words, phrases, and sentences within a given context.\n2. **Generate text**: Produce coherent and natural-sounding text based on a prompt, topic, or style.\n3. **Translate language**: Convert text from one language to another.\n4. **Summarize content**: Distill long pieces of text into concise summaries.\n5. **Answer questions**: Respond to questions and provide relevant information.\n6. **Chat and converse**: Engage in natural-sounding conversations, using context and understanding to respond to questions and statements.\n\nSome key characteristics of large language models include:\n\n* **Scale**: They are trained on massive datasets, often containing billions of words or more.\n* **Depth**: They have many layers of neural networks, which allow them to capture complex patterns and relationships in language.\n* **Generative capabilities**: They can generate text that is often indistinguishable from human-written content.\n\nExamples of large language models include:\n\n* Transformer models (e.g., BERT, RoBERTa)\n* Recurrent neural network (RNN) models (e.g., LSTM, GRU)\n* Generative adversarial network (GAN) models\n\nLarge language models have many applications, such as:\n\n* **Virtual assistants**: Powering chatbots, voice assistants, and other conversational interfaces.\n* **Language translation**: Enabling accurate and efficient translation of text and speech.\n* **Text generation**: Automating content creation, such as articles, social media posts, and product descriptions.\n* **Sentiment analysis**: Analyzing text to determine sentiment, emotion, and opinion.\n\nHowever, large language models also raise important questions and concerns, such as:\n\n* **Bias and fairness**: How do we ensure that these models are fair, transparent, and free from bias?\n* **Explainability**: How can we understand and interpret the decisions made by these complex models?\n* **Security**: How can we protect against potential misuse or manipulation of these powerful models?\n\nI hope this helps! Do you have any specific questions or topics related to large language models that you'd like me to expand on?",
"tokens": 1746,
"success": true
}