@umituz/react-native-ai-groq-provider 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -104,7 +104,7 @@ class ChatSessionService {
|
|
|
104
104
|
async send(
|
|
105
105
|
sessionId: string,
|
|
106
106
|
content: string,
|
|
107
|
-
|
|
107
|
+
_options: SendChatMessageOptions = {}
|
|
108
108
|
): Promise<ChatSendResult> {
|
|
109
109
|
const session = this.sessions.get(sessionId);
|
|
110
110
|
if (!session) {
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useState, useCallback, useRef } from "react";
|
|
7
|
-
import type { GroqGenerationConfig
|
|
8
|
-
import {
|
|
9
|
-
import { chatSessionService } from "../../infrastructure/services/ChatSession";
|
|
10
|
-
import { textGeneration, chatGeneration } from "../../infrastructure/services/TextGeneration";
|
|
7
|
+
import type { GroqGenerationConfig } from "../../domain/entities";
|
|
8
|
+
import { textGeneration } from "../../infrastructure/services/TextGeneration";
|
|
11
9
|
import { structuredText } from "../../infrastructure/services/StructuredText";
|
|
12
10
|
import { streaming } from "../../infrastructure/services/Streaming";
|
|
13
11
|
import { getUserFriendlyError } from "../../infrastructure/utils/error-mapper.util";
|
|
@@ -167,7 +165,7 @@ export function useGroq(options: UseGroqOptions = {}): UseGroqReturn {
|
|
|
167
165
|
options.onStart?.();
|
|
168
166
|
|
|
169
167
|
try {
|
|
170
|
-
for await (const
|
|
168
|
+
for await (const streamingResult of streaming(prompt, {
|
|
171
169
|
model: options.model,
|
|
172
170
|
generationConfig: { ...options.generationConfig, ...config },
|
|
173
171
|
callbacks: {
|
|
@@ -177,7 +175,8 @@ export function useGroq(options: UseGroqOptions = {}): UseGroqReturn {
|
|
|
177
175
|
},
|
|
178
176
|
},
|
|
179
177
|
})) {
|
|
180
|
-
//
|
|
178
|
+
// Consume the async iterator (streaming is handled via callbacks)
|
|
179
|
+
void streamingResult;
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
setResult(fullContent);
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Factory for creating configured Groq provider instances
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { GroqConfig, GroqGenerationConfig } from "../domain/entities";
|
|
7
6
|
import { groqHttpClient } from "../infrastructure/services/GroqClient";
|
|
8
7
|
import { ConfigBuilder, GenerationConfigBuilder } from "./ConfigBuilder";
|
|
9
8
|
|