PhysNOR class
A small adapter that talks to a Gemini-style generative model and
presents a PhysNOR helper to fetch physics answers.
Properties
- apiKey → String
-
final
-
conversation
→ List<
Map< String, String> > -
Optional in-memory conversation useful for chat apps. Each message is a
map with keys: 'author' and 'content'. Use
addUserMessage/addAssistantMessageto manage it.final - hashCode → int
-
The hash code for this object.
no setterinherited
- model ↔ String
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- systemPrompt → String
-
final
Methods
-
addAssistantMessage(
String content) → void - Add an assistant message to the in-memory conversation.
-
addUserMessage(
String content) → void - Add a user message to the in-memory conversation.
-
ask(
String question, {double temperature = 0.2}) → Future< String> - Ask the physics specialist a question and return the raw text response.
-
buildChatPayload(
List< Map< messages, double temperature) → Map<String, String> >String, dynamic> - Build a chat-style payload from a list of messages (maps with 'author'/'content'). Ensures the system prompt is the first message.
-
buildRequestPayload(
String question, double temperature) → Map< String, dynamic> - Build the JSON payload sent to the AI endpoint.
-
chatAsk(
List< Map< messages, {double temperature = 0.2}) → Future<String, String> >String> - Send a chat-style list of messages to the model and return the text.
-
clearConversation(
) → void - Clear the in-memory conversation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setModel(
String newModel) → void - Change the target model (e.g. 'models/gemini' or 'myOrg/myModel').
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited