GenerativeModel class

A class for generating content using OpenTyphoon's generative AI models.

This class handles the communication with OpenTyphoon's API for text generation and content creation tasks. It provides methods to generate content based on given prompts and parameters.

Example usage:

final model = GenerativeModel(
  model: 'model-name',
  apiKey: 'your-api-key'
);
final response = await model.generateContent([
  {'role': 'user', 'content': 'Hello!'}
]);

Constructors

GenerativeModel.new({required String model, required String apiKey})
Creates a new instance of GenerativeModel.

Properties

apiKey String
The API key used for authentication with the OpenTyphoon API.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
model String
The identifier of the AI model to use for generation.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generateContent(List<Map<String, String>> contents) Future<GenerateContentResponse>
Generates content based on the provided input messages.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

uri → const String
The base URI for the OpenTyphoon API endpoints.