Meta Llama Extension
The MetaLlama extension facilitates interaction with the Llama AI model for chat functionalities in Android apps developed using MIT App Inventor. With this extension, users can seamlessly integrate Llama AI’s powerful chat capabilities into their applications.
All Blocks
Doc
-
Token()
:
- Description: Getter method for the API token.
- Returns: The API token.
-
Token(String token)
:
- Description: Setter method for the API token.
- Parameters:
-
token
(String): The API token to set.
-
-
FromJsonArray(String json, String key)
:
- Description: Parses a JSON array and retrieves the value corresponding to a specific key from the JSON objects within the array.
- Parameters:
-
json
(String): The JSON array to parse. -
key
(String): The key whose value is to be retrieved.
-
- Returns: The value corresponding to the specified key, or
null
if the key is not found.
-
FromJsonObject(String json, String key)
:
- Description: Parses a JSON object and retrieves the value corresponding to a specific key.
- Parameters:
-
json
(String): The JSON object to parse. -
key
(String): The key whose value is to be retrieved.
-
- Returns: The value corresponding to the specified key, or
null
if the key is not found.
-
CreateChat(YailDictionary messages)
:
- Description: Initiates the creation of a chat asynchronously.
- Parameters:
-
messages
(YailDictionary): A dictionary containing chat messages.
-
- Events:
-
OnCreateChat(String result)
: Triggered when the chat creation is successful, providing the result. -
OnCreateChatError(String message)
: Triggered when an error occurs during chat creation, providing an error message.
-
-
OnCreateChat(String result)
:
- Description: Event raised when a chat is successfully created.
- Parameters:
-
result
(String): The result of the chat creation process.
-
-
OnCreateChatError(String message)
:
- Description: Event raised when an error occurs during chat creation.
- Parameters:
-
message
(String): The error message.
-
Demo Blocks
Demo
Source Code
AIX:
Q: How to get api token?
A: just go to “llama-api.com” and login then go to “Llama API” to get token like this
Thanks For
- @NotAnAdminUser for beta test it