@orbe-agro/client-core 5.6.328 → 5.6.330
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/dist/@ecme/components/template/Footer.js +1 -1
- package/dist/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.js +7 -1
- package/dist/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/ChatBox.js +3 -1
- package/dist/@ecme/components/view/ChatBox/ChatBox.js.map +1 -1
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js +2 -1
- package/dist/@ecme/components/view/ChatBox/components/ChatInput.js.map +1 -1
- package/dist/@ecme/services/AiService.js +4 -2
- package/dist/@ecme/services/AiService.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js +6 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.js +85 -0
- package/dist/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.js.map +1 -0
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js +15 -3
- package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js.map +1 -1
- package/dist/@ecme/views/concepts/ai/Chat/store/esforcoStore.js +15 -0
- package/dist/@ecme/views/concepts/ai/Chat/store/esforcoStore.js.map +1 -0
- package/dist/@types/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.d.ts.map +1 -1
- package/dist/@types/@ecme/components/view/ChatBox/ChatBox.d.ts.map +1 -1
- package/dist/@types/@ecme/components/view/ChatBox/components/ChatInput.d.ts +3 -1
- package/dist/@types/@ecme/components/view/ChatBox/components/ChatInput.d.ts.map +1 -1
- package/dist/@types/@ecme/services/AiService.d.ts +7 -3
- package/dist/@types/@ecme/services/AiService.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ChatView.d.ts +6 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/ChatView.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.d.ts +14 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useChatSend.d.ts.map +1 -1
- package/dist/@types/@ecme/views/concepts/ai/Chat/store/esforcoStore.d.ts +27 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/store/esforcoStore.d.ts.map +1 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/types.d.ts +7 -0
- package/dist/@types/@ecme/views/concepts/ai/Chat/types.d.ts.map +1 -1
- package/dist/@types/base/services/modules/racao/carga/CargaService.d.ts +1 -1
- package/dist/@types/base/services/modules/racao/carga/CargaService.d.ts.map +1 -1
- package/dist/base/services/modules/racao/carga/CargaService.js +5 -2
- package/dist/base/services/modules/racao/carga/CargaService.js.map +1 -1
- package/lib/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.tsx +4 -1
- package/lib/@ecme/components/view/ChatBox/ChatBox.tsx +2 -0
- package/lib/@ecme/components/view/ChatBox/components/ChatInput.tsx +5 -2
- package/lib/@ecme/services/AiService.ts +9 -3
- package/lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx +13 -1
- package/lib/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.tsx +115 -0
- package/lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts +18 -3
- package/lib/@ecme/views/concepts/ai/Chat/store/esforcoStore.ts +25 -0
- package/lib/@ecme/views/concepts/ai/Chat/types.ts +8 -0
- package/lib/base/services/modules/racao/carga/CargaService.ts +4 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
export type ChatInputProps = {
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
onInputChange?: (payload: {
|
|
@@ -6,6 +6,8 @@ export type ChatInputProps = {
|
|
|
6
6
|
attachments: File[];
|
|
7
7
|
}) => void;
|
|
8
8
|
ref?: Ref<HTMLInputElement>;
|
|
9
|
+
/** Controles extras dentro da caixa, logo antes do botão de enviar. */
|
|
10
|
+
inputActions?: ReactNode;
|
|
9
11
|
};
|
|
10
12
|
declare const ChatInput: (props: ChatInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default ChatInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/components/view/ChatBox/components/ChatInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/components/view/ChatBox/components/ChatInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAiB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE1D,MAAM,MAAM,cAAc,GAAG;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,IAAI,EAAE,CAAA;KAAE,KAAK,IAAI,CAAA;IACzE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC3B,uEAAuE;IACvE,YAAY,CAAC,EAAE,SAAS,CAAA;CAC3B,CAAA;AAID,QAAA,MAAM,SAAS,GAAI,OAAO,cAAc,4CA4EvC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatEvent } from '@/views/concepts/ai/Chat/types';
|
|
1
|
+
import type { ChatEvent, Esforco } from '@/views/concepts/ai/Chat/types';
|
|
2
2
|
export declare const AI_API_URL: string;
|
|
3
3
|
export declare function apiGetChatHistory<T>(conversationId?: string): Promise<T>;
|
|
4
4
|
/** Conversas do usuário (só o resumo), a mais recente primeiro. */
|
|
@@ -10,6 +10,8 @@ export type StreamChatParams = {
|
|
|
10
10
|
prompt: string;
|
|
11
11
|
/** Identifica a conversa; o backend usa como thread da memoria. */
|
|
12
12
|
conversationId?: string;
|
|
13
|
+
/** Nivel de raciocinio desta mensagem; ausente = o padrao do backend. */
|
|
14
|
+
esforco?: Esforco;
|
|
13
15
|
signal?: AbortSignal;
|
|
14
16
|
onEvent: (evento: ChatEvent) => void;
|
|
15
17
|
};
|
|
@@ -23,6 +25,8 @@ export type ResumeChatParams = {
|
|
|
23
25
|
approved?: boolean;
|
|
24
26
|
dados?: Record<string, unknown> | null;
|
|
25
27
|
conversationId?: string;
|
|
28
|
+
/** A retomada tambem chama o modelo: vale o mesmo nivel do envio. */
|
|
29
|
+
esforco?: Esforco;
|
|
26
30
|
signal?: AbortSignal;
|
|
27
31
|
onEvent: (evento: ChatEvent) => void;
|
|
28
32
|
};
|
|
@@ -32,7 +36,7 @@ export type ResumeChatParams = {
|
|
|
32
36
|
* Usa `fetch`, e nao o Axios, porque o Axios no browser so resolve a Promise
|
|
33
37
|
* com a resposta inteira — nao ha como ler o corpo enquanto ele chega.
|
|
34
38
|
*/
|
|
35
|
-
export declare function streamChat({ prompt, conversationId, signal, onEvent, }: StreamChatParams): Promise<void>;
|
|
39
|
+
export declare function streamChat({ prompt, conversationId, esforco, signal, onEvent, }: StreamChatParams): Promise<void>;
|
|
36
40
|
/**
|
|
37
41
|
* Retoma uma conversa parada numa pausa (aprovacao ou coleta de dados).
|
|
38
42
|
*
|
|
@@ -42,7 +46,7 @@ export declare function streamChat({ prompt, conversationId, signal, onEvent, }:
|
|
|
42
46
|
* O `JSON.stringify` descarta chaves `undefined`, entao o backend recebe apenas
|
|
43
47
|
* o campo da pausa que esta sendo respondida.
|
|
44
48
|
*/
|
|
45
|
-
export declare function resumeChat({ approved, dados, conversationId, signal, onEvent, }: ResumeChatParams): Promise<void>;
|
|
49
|
+
export declare function resumeChat({ approved, dados, conversationId, esforco, signal, onEvent, }: ResumeChatParams): Promise<void>;
|
|
46
50
|
export declare function apiGetImages<T, U extends Record<string, unknown>>(params: U): Promise<T>;
|
|
47
51
|
export declare function apiPostImages<T, U extends Record<string, unknown>>(data: U): Promise<T>;
|
|
48
52
|
//# sourceMappingURL=AiService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiService.d.ts","sourceRoot":"","sources":["../../../../lib/@ecme/services/AiService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"AiService.d.ts","sourceRoot":"","sources":["../../../../lib/@ecme/services/AiService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AA6BxE,eAAO,MAAM,UAAU,QAAgB,CAAA;AAcvC,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,MAAM,cAMjE;AAED,mEAAmE;AACnE,wBAAsB,mBAAmB,CAAC,CAAC,gBAK1C;AAED,wBAAsB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBAMhF;AAED,yDAAyD;AACzD,wBAAsB,qBAAqB,CAAC,cAAc,EAAE,MAAM,iBAKjE;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAA;CACvC,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACtC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAA;CACvC,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,EAC7B,MAAM,EACN,cAAc,EACd,OAAO,EACP,MAAM,EACN,OAAO,GACV,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOlC;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,cAAc,EACd,OAAO,EACP,MAAM,EACN,OAAO,GACV,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOlC;AAiCD,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,MAAM,EAAE,CAAC,cAOZ;AAED,wBAAsB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,IAAI,EAAE,CAAC,cAOV"}
|
|
@@ -4,7 +4,12 @@ type ChatViewProps = {
|
|
|
4
4
|
* flutuante desliga, porque tem o próprio drawer dentro do painel.
|
|
5
5
|
*/
|
|
6
6
|
showMobileNav?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Classes dos menus flutuantes do chat. O widget passa um z-index acima do
|
|
9
|
+
* próprio painel; sem isso o menu abriria atrás dele.
|
|
10
|
+
*/
|
|
11
|
+
dropdownFloatingClass?: string;
|
|
7
12
|
};
|
|
8
|
-
declare const ChatView: ({ showMobileNav }: ChatViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const ChatView: ({ showMobileNav, dropdownFloatingClass, }: ChatViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
14
|
export default ChatView;
|
|
10
15
|
//# sourceMappingURL=ChatView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatView.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatView.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx"],"names":[],"mappings":"AAqCA,KAAK,aAAa,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;CACjC,CAAA;AAED,QAAA,MAAM,QAAQ,GAAI,2CAGf,aAAa,4CA2Mf,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type EsforcoRaciocinioProps = {
|
|
2
|
+
/** Classes do menu flutuante; o widget passa um z-index acima do painel. */
|
|
3
|
+
floatingClass?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Seletor do nível de raciocínio, dentro da caixa de mensagem.
|
|
7
|
+
*
|
|
8
|
+
* O botão mostra o nível atual; o menu abre para cima, com uma linha
|
|
9
|
+
* explicando cada nível. A escolha vale para as próximas mensagens (e para as
|
|
10
|
+
* retomadas de aprovação e de formulário); as respostas já dadas não mudam.
|
|
11
|
+
*/
|
|
12
|
+
declare const EsforcoRaciocinio: ({ floatingClass }: EsforcoRaciocinioProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default EsforcoRaciocinio;
|
|
14
|
+
//# sourceMappingURL=EsforcoRaciocinio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EsforcoRaciocinio.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/EsforcoRaciocinio.tsx"],"names":[],"mappings":"AAuCA,KAAK,sBAAsB,GAAG;IAC1B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,GAAI,mBAAmB,sBAAsB,4CA6DnE,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatSend.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChatSend.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,WAAW;yBA0MqB,MAAM;6BA2B5B,MAAM,aACH,MAAM,YACP,OAAO;+BAqCT,MAAM,aACH,MAAM,SACV,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CA8B5C,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Esforco } from '../types';
|
|
2
|
+
type EsforcoState = {
|
|
3
|
+
esforco: Esforco;
|
|
4
|
+
setEsforco: (payload: Esforco) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Nível de raciocínio escolhido no chat.
|
|
8
|
+
*
|
|
9
|
+
* Persistido no navegador, como tema e idioma: é preferência de uso, não dado
|
|
10
|
+
* da conversa. Por isso mora fora do `generativeChatStore`, que não persiste e
|
|
11
|
+
* é zerado quando o usuário da sessão muda.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useEsforcoStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<EsforcoState>, "setState" | "persist"> & {
|
|
14
|
+
setState(partial: EsforcoState | Partial<EsforcoState> | ((state: EsforcoState) => EsforcoState | Partial<EsforcoState>), replace?: false | undefined): unknown;
|
|
15
|
+
setState(state: EsforcoState | ((state: EsforcoState) => EsforcoState), replace: true): unknown;
|
|
16
|
+
persist: {
|
|
17
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<EsforcoState, EsforcoState, unknown>>) => void;
|
|
18
|
+
clearStorage: () => void;
|
|
19
|
+
rehydrate: () => Promise<void>;
|
|
20
|
+
hasHydrated: () => boolean;
|
|
21
|
+
onHydrate: (fn: (state: EsforcoState) => void) => () => void;
|
|
22
|
+
onFinishHydration: (fn: (state: EsforcoState) => void) => () => void;
|
|
23
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<EsforcoState, EsforcoState, unknown>>;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=esforcoStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esforcoStore.d.ts","sourceRoot":"","sources":["../../../../../../../../lib/@ecme/views/concepts/ai/Chat/store/esforcoStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,KAAK,YAAY,GAAG;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CACzC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;EAQ3B,CAAA"}
|
|
@@ -187,6 +187,13 @@ export type HistoryMessage = Omit<Conversation, 'timestamp'> & {
|
|
|
187
187
|
export type HistoryChat = Omit<ChatHistory, 'conversation'> & {
|
|
188
188
|
conversation: HistoryMessage[];
|
|
189
189
|
};
|
|
190
|
+
/**
|
|
191
|
+
* Nível de raciocínio do modelo, escolhido no chat e enviado em cada mensagem.
|
|
192
|
+
*
|
|
193
|
+
* Os valores são os do OpenRouter, sem tradução — o backend valida contra o
|
|
194
|
+
* mesmo conjunto (enum `Esforco`) e responde 422 para qualquer outro.
|
|
195
|
+
*/
|
|
196
|
+
export type Esforco = 'minimal' | 'medium' | 'high' | 'max';
|
|
190
197
|
/** Resumo de uma conversa, como vem do GET /ai/chat/conversations. */
|
|
191
198
|
export type ConversationSummary = {
|
|
192
199
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/types.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED,wEAAwE;AACxE,MAAM,MAAM,eAAe,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;CACvE,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,EAAE,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,cAAc,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AAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,EAAE,CAAA"}
|
|
@@ -7,7 +7,7 @@ export declare function apiDeleteRacaoCarga(id: number): Promise<TQueryResponse<
|
|
|
7
7
|
export declare function apiAprovarRacaoCarga(id: number, body: TAprovarRacaoCarga): Promise<TQueryResponse<TCarga>>;
|
|
8
8
|
export declare function apiReprovarRacaoCarga(id: number, justificativa: string): Promise<TQueryResponse<TCarga>>;
|
|
9
9
|
export declare function apiFindMonitorRacaoCarga(body?: IFilterParams): Promise<TQueryResponse<TCarga>>;
|
|
10
|
-
export declare function apiFindOrdensDisponiveisRacaoCarga(vendedorId: number, centroId: number, incotermsId: number): Promise<TQueryResponse<TCarga>>;
|
|
10
|
+
export declare function apiFindOrdensDisponiveisRacaoCarga(vendedorId: number, centroId: number, incotermsId: number, vendedoresDivisaoIds?: number[]): Promise<TQueryResponse<TCarga>>;
|
|
11
11
|
export declare function apiFindContadoresRacaoCarga(): Promise<TContadoresCarga>;
|
|
12
12
|
export declare function apiFindContadoresEtapaAgendamentoRacaoCarga(): Promise<TContadoresEtapaAgendamentoCarga>;
|
|
13
13
|
//# sourceMappingURL=CargaService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CargaService.d.ts","sourceRoot":"","sources":["../../../../../../../lib/base/services/modules/racao/carga/CargaService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAKjI,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,mBAKhD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,mCAMlD;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,mCAMrD;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,mCAKnD;AAED,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,mCAM9E;AAED,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,mCAM5E;AAED,wBAAsB,wBAAwB,CAAC,IAAI,CAAC,EAAE,aAAa,mCAMlE;AAED,wBAAsB,kCAAkC,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CargaService.d.ts","sourceRoot":"","sources":["../../../../../../../lib/base/services/modules/racao/carga/CargaService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAKjI,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,mBAKhD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,mCAMlD;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,mCAMrD;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,mCAKnD;AAED,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,mCAM9E;AAED,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,mCAM5E;AAED,wBAAsB,wBAAwB,CAAC,IAAI,CAAC,EAAE,aAAa,mCAMlE;AAED,wBAAsB,kCAAkC,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,GAAE,MAAM,EAAO,mCAQtJ;AAED,wBAAsB,2BAA2B,8BAKhD;AAED,wBAAsB,2CAA2C,8CAKhE"}
|
|
@@ -48,10 +48,13 @@ async function apiFindMonitorRacaoCarga(body) {
|
|
|
48
48
|
data: body
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
async function apiFindOrdensDisponiveisRacaoCarga(vendedorId, centroId, incotermsId) {
|
|
51
|
+
async function apiFindOrdensDisponiveisRacaoCarga(vendedorId, centroId, incotermsId, vendedoresDivisaoIds = []) {
|
|
52
52
|
return ApiService.fetchDataWithAxios({
|
|
53
53
|
url: CARGA_ENDPOINT.findOrdensDisponiveis.endpoint + `${vendedorId}/${centroId}/${incotermsId}`,
|
|
54
|
-
method: CARGA_ENDPOINT.findOrdensDisponiveis.method
|
|
54
|
+
method: CARGA_ENDPOINT.findOrdensDisponiveis.method,
|
|
55
|
+
params: {
|
|
56
|
+
...vendedoresDivisaoIds.length > 0 && { vendedoresDivisaoIds: vendedoresDivisaoIds.join(",") }
|
|
57
|
+
}
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
async function apiFindContadoresRacaoCarga() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CargaService.js","sources":["../../../../../../lib/base/services/modules/racao/carga/CargaService.ts"],"sourcesContent":["import ApiService from \"@/services/ApiService\";\nimport { IFilterParams, TQueryResponse } from \"@base/@types/api\";\nimport { TCarga, TAprovarRacaoCarga, TContadoresCarga, TContadoresEtapaAgendamentoCarga } from \"@base/@types/models/racao/carga\";\nimport endpointConfig from \"@base/configs/endpoints.config/endpoints.navigation\";\n\nconst CARGA_ENDPOINT = endpointConfig.racao.carga;\n\nexport async function apiGetRacaoCarga(id: number) {\n return ApiService.fetchDataWithAxios<TCarga>({\n url: CARGA_ENDPOINT.findOne.endpoint + `${id}`,\n method: CARGA_ENDPOINT.findOne.method,\n })\n}\n\nexport async function apiAddRacaoCarga(body: TCarga) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.add.endpoint,\n method: CARGA_ENDPOINT.add.method,\n data: body,\n })\n}\n\nexport async function apiUpdateRacaoCarga(body: TCarga) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.update.endpoint,\n method: CARGA_ENDPOINT.update.method,\n data: body,\n })\n}\n\nexport async function apiDeleteRacaoCarga(id: number) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.delete.endpoint + `${id}`,\n method: CARGA_ENDPOINT.delete.method,\n })\n}\n\nexport async function apiAprovarRacaoCarga(id: number, body: TAprovarRacaoCarga) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.aprovar.endpoint + `${id}`,\n method: CARGA_ENDPOINT.aprovar.method,\n data: body,\n })\n}\n\nexport async function apiReprovarRacaoCarga(id: number, justificativa: string) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.reprovar.endpoint + `${id}`,\n method: CARGA_ENDPOINT.reprovar.method,\n data: { justificativa },\n })\n}\n\nexport async function apiFindMonitorRacaoCarga(body?: IFilterParams) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.findMonitor.endpoint,\n method: CARGA_ENDPOINT.findMonitor.method,\n data: body,\n })\n}\n\nexport async function apiFindOrdensDisponiveisRacaoCarga(vendedorId: number, centroId: number, incotermsId: number) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.findOrdensDisponiveis.endpoint + `${vendedorId}/` + `${centroId}/` + `${incotermsId}`,\n method: CARGA_ENDPOINT.findOrdensDisponiveis.method,\n })\n}\n\nexport async function apiFindContadoresRacaoCarga() {\n return ApiService.fetchDataWithAxios<TContadoresCarga>({\n url: CARGA_ENDPOINT.findContadores.endpoint,\n method: CARGA_ENDPOINT.findContadores.method,\n })\n}\n\nexport async function apiFindContadoresEtapaAgendamentoRacaoCarga() {\n return ApiService.fetchDataWithAxios<TContadoresEtapaAgendamentoCarga>({\n url: CARGA_ENDPOINT.findContadoresEtapaAgendamento.endpoint,\n method: CARGA_ENDPOINT.findContadoresEtapaAgendamento.method,\n })\n}\n"],"names":["endpointConfig"],"mappings":";;AAKA,MAAM,iBAAiBA,yBAAe,MAAM;AAE5C,eAAsB,iBAAiB,IAAY;AAC/C,SAAO,WAAW,mBAA2B;AAAA,IACzC,KAAK,eAAe,QAAQ,WAAW,GAAG,EAAE;AAAA,IAC5C,QAAQ,eAAe,QAAQ;AAAA,EAAA,CAClC;AACL;AAEA,eAAsB,iBAAiB,MAAc;AACjD,SAAO,WAAW,mBAA2C;AAAA,IACzD,KAAK,eAAe,IAAI;AAAA,IACxB,QAAQ,eAAe,IAAI;AAAA,IAC3B,MAAM;AAAA,EAAA,CACT;AACL;AAEA,eAAsB,oBAAoB,MAAc;AACpD,SAAO,WAAW,mBAA2C;AAAA,IACzD,KAAK,eAAe,OAAO;AAAA,IAC3B,QAAQ,eAAe,OAAO;AAAA,IAC9B,MAAM;AAAA,EAAA,CACT;AACL;AAEA,eAAsB,oBAAoB,IAAY;AAClD,SAAO,WAAW,mBAA2C;AAAA,IACzD,KAAK,eAAe,OAAO,WAAW,GAAG,EAAE;AAAA,IAC3C,QAAQ,eAAe,OAAO;AAAA,EAAA,CACjC;AACL;AAEA,eAAsB,qBAAqB,IAAY,MAA0B;AAC7E,SAAO,WAAW,mBAA2C;AAAA,IACzD,KAAK,eAAe,QAAQ,WAAW,GAAG,EAAE;AAAA,IAC5C,QAAQ,eAAe,QAAQ;AAAA,IAC/B,MAAM;AAAA,EAAA,CACT;AACL;AAEA,eAAsB,sBAAsB,IAAY,eAAuB;AAC3E,SAAO,WAAW,mBAA2C;AAAA,IACzD,KAAK,eAAe,SAAS,WAAW,GAAG,EAAE;AAAA,IAC7C,QAAQ,eAAe,SAAS;AAAA,IAChC,MAAM,EAAE,cAAA;AAAA,EAAc,CACzB;AACL;AAEA,eAAsB,yBAAyB,MAAsB;AACjE,SAAO,WAAW,mBAA2C;AAAA,IACzD,KAAK,eAAe,YAAY;AAAA,IAChC,QAAQ,eAAe,YAAY;AAAA,IACnC,MAAM;AAAA,EAAA,CACT;AACL;AAEA,eAAsB,mCAAmC,YAAoB,UAAkB,aAAqB;
|
|
1
|
+
{"version":3,"file":"CargaService.js","sources":["../../../../../../lib/base/services/modules/racao/carga/CargaService.ts"],"sourcesContent":["import ApiService from \"@/services/ApiService\";\nimport { IFilterParams, TQueryResponse } from \"@base/@types/api\";\nimport { TCarga, TAprovarRacaoCarga, TContadoresCarga, TContadoresEtapaAgendamentoCarga } from \"@base/@types/models/racao/carga\";\nimport endpointConfig from \"@base/configs/endpoints.config/endpoints.navigation\";\n\nconst CARGA_ENDPOINT = endpointConfig.racao.carga;\n\nexport async function apiGetRacaoCarga(id: number) {\n return ApiService.fetchDataWithAxios<TCarga>({\n url: CARGA_ENDPOINT.findOne.endpoint + `${id}`,\n method: CARGA_ENDPOINT.findOne.method,\n })\n}\n\nexport async function apiAddRacaoCarga(body: TCarga) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.add.endpoint,\n method: CARGA_ENDPOINT.add.method,\n data: body,\n })\n}\n\nexport async function apiUpdateRacaoCarga(body: TCarga) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.update.endpoint,\n method: CARGA_ENDPOINT.update.method,\n data: body,\n })\n}\n\nexport async function apiDeleteRacaoCarga(id: number) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.delete.endpoint + `${id}`,\n method: CARGA_ENDPOINT.delete.method,\n })\n}\n\nexport async function apiAprovarRacaoCarga(id: number, body: TAprovarRacaoCarga) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.aprovar.endpoint + `${id}`,\n method: CARGA_ENDPOINT.aprovar.method,\n data: body,\n })\n}\n\nexport async function apiReprovarRacaoCarga(id: number, justificativa: string) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.reprovar.endpoint + `${id}`,\n method: CARGA_ENDPOINT.reprovar.method,\n data: { justificativa },\n })\n}\n\nexport async function apiFindMonitorRacaoCarga(body?: IFilterParams) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.findMonitor.endpoint,\n method: CARGA_ENDPOINT.findMonitor.method,\n data: body,\n })\n}\n\nexport async function apiFindOrdensDisponiveisRacaoCarga(vendedorId: number, centroId: number, incotermsId: number, vendedoresDivisaoIds: number[] = []) {\n return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({\n url: CARGA_ENDPOINT.findOrdensDisponiveis.endpoint + `${vendedorId}/` + `${centroId}/` + `${incotermsId}`,\n method: CARGA_ENDPOINT.findOrdensDisponiveis.method,\n params: {\n ...(vendedoresDivisaoIds.length > 0 && { vendedoresDivisaoIds: vendedoresDivisaoIds.join(',') }),\n },\n })\n}\n\nexport async function apiFindContadoresRacaoCarga() {\n return ApiService.fetchDataWithAxios<TContadoresCarga>({\n url: CARGA_ENDPOINT.findContadores.endpoint,\n method: CARGA_ENDPOINT.findContadores.method,\n })\n}\n\nexport async function apiFindContadoresEtapaAgendamentoRacaoCarga() {\n return ApiService.fetchDataWithAxios<TContadoresEtapaAgendamentoCarga>({\n url: CARGA_ENDPOINT.findContadoresEtapaAgendamento.endpoint,\n method: CARGA_ENDPOINT.findContadoresEtapaAgendamento.method,\n })\n}\n"],"names":["endpointConfig"],"mappings":";;AAKA,MAAM,iBAAiBA,yBAAe,MAAM;AAE5C,eAAsB,iBAAiB,IAAY;AAC/C,SAAO,WAAW,mBAA2B;AAAA,IACzC,KAAK,eAAe,QAAQ,WAAW,GAAG,EAA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AAW;AAAA,IACvG,QAAQ,eAAe,sBAAsB;AAAA,IAC7C,QAAQ;AAAA,MACJ,GAAI,qBAAqB,SAAS,KAAK,EAAE,sBAAsB,qBAAqB,KAAK,GAAG,EAAA;AAAA,IAAE;AAAA,EAClG,CACH;AACL;AAEA,eAAsB,8BAA8B;AAChD,SAAO,WAAW,mBAAqC;AAAA,IACnD,KAAK,eAAe,eAAe;AAAA,IACnC,QAAQ,eAAe,eAAe;AAAA,EAAA,CACzC;AACL;AAEA,eAAsB,8CAA8C;AAChE,SAAO,WAAW,mBAAqD;AAAA,IACnE,KAAK,eAAe,+BAA+B;AAAA,IACnD,QAAQ,eAAe,+BAA+B;AAAA,EAAA,CACzD;AACL;"}
|
|
@@ -125,7 +125,10 @@ const OrbeAiWidget = () => {
|
|
|
125
125
|
</div>
|
|
126
126
|
|
|
127
127
|
<div className="min-h-0 flex-1 p-2">
|
|
128
|
-
<ChatView
|
|
128
|
+
<ChatView
|
|
129
|
+
showMobileNav={false}
|
|
130
|
+
dropdownFloatingClass="!z-[10000]"
|
|
131
|
+
/>
|
|
129
132
|
<ChatHistoryRenameDialog overlayClassName="!z-[10000]" />
|
|
130
133
|
</div>
|
|
131
134
|
|
|
@@ -27,6 +27,7 @@ const ChatBox = forwardRef<ScrollBarRef, ChatBoxProps>((props, ref) => {
|
|
|
27
27
|
header,
|
|
28
28
|
placeholder,
|
|
29
29
|
onInputChange,
|
|
30
|
+
inputActions,
|
|
30
31
|
showAvatar,
|
|
31
32
|
avatarGap,
|
|
32
33
|
customRenderer,
|
|
@@ -49,6 +50,7 @@ const ChatBox = forwardRef<ScrollBarRef, ChatBoxProps>((props, ref) => {
|
|
|
49
50
|
<ChatInput
|
|
50
51
|
placeholder={placeholder}
|
|
51
52
|
onInputChange={onInputChange}
|
|
53
|
+
inputActions={inputActions}
|
|
52
54
|
/>
|
|
53
55
|
}
|
|
54
56
|
>
|
|
@@ -3,12 +3,14 @@ import Button from '@/components/ui/Button'
|
|
|
3
3
|
import Upload from '@/components/ui/Upload'
|
|
4
4
|
import hooks from '@/components/ui/hooks'
|
|
5
5
|
import { TbPhotoPlus, TbArrowRight } from 'react-icons/tb'
|
|
6
|
-
import type { KeyboardEvent, Ref } from 'react'
|
|
6
|
+
import type { KeyboardEvent, ReactNode, Ref } from 'react'
|
|
7
7
|
|
|
8
8
|
export type ChatInputProps = {
|
|
9
9
|
placeholder?: string
|
|
10
10
|
onInputChange?: (payload: { value: string; attachments: File[] }) => void
|
|
11
11
|
ref?: Ref<HTMLInputElement>
|
|
12
|
+
/** Controles extras dentro da caixa, logo antes do botão de enviar. */
|
|
13
|
+
inputActions?: ReactNode
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
const { useMergeRef } = hooks
|
|
@@ -16,7 +18,7 @@ const { useMergeRef } = hooks
|
|
|
16
18
|
const ChatInput = (props: ChatInputProps) => {
|
|
17
19
|
const [attachments, setAttachments] = useState<File[]>([])
|
|
18
20
|
|
|
19
|
-
const { placeholder, onInputChange, ref = null } = props
|
|
21
|
+
const { placeholder, onInputChange, ref = null, inputActions } = props
|
|
20
22
|
|
|
21
23
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
22
24
|
|
|
@@ -78,6 +80,7 @@ const ChatInput = (props: ChatInputProps) => {
|
|
|
78
80
|
placeholder={placeholder}
|
|
79
81
|
onKeyDown={handleKeyDown}
|
|
80
82
|
/>
|
|
83
|
+
{inputActions}
|
|
81
84
|
<Button
|
|
82
85
|
size="xs"
|
|
83
86
|
shape="circle"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { authHeaders } from './aiAuthHeaders'
|
|
2
2
|
import ApiService from './ApiService'
|
|
3
3
|
import { readSse } from './sseParser'
|
|
4
|
-
import type { ChatEvent } from '@/views/concepts/ai/Chat/types'
|
|
4
|
+
import type { ChatEvent, Esforco } from '@/views/concepts/ai/Chat/types'
|
|
5
5
|
import type { AxiosRequestConfig } from 'axios'
|
|
6
6
|
|
|
7
7
|
const AI_DEV_URL = 'http://localhost:8000'
|
|
@@ -80,6 +80,8 @@ export type StreamChatParams = {
|
|
|
80
80
|
prompt: string
|
|
81
81
|
/** Identifica a conversa; o backend usa como thread da memoria. */
|
|
82
82
|
conversationId?: string
|
|
83
|
+
/** Nivel de raciocinio desta mensagem; ausente = o padrao do backend. */
|
|
84
|
+
esforco?: Esforco
|
|
83
85
|
signal?: AbortSignal
|
|
84
86
|
onEvent: (evento: ChatEvent) => void
|
|
85
87
|
}
|
|
@@ -94,6 +96,8 @@ export type ResumeChatParams = {
|
|
|
94
96
|
approved?: boolean
|
|
95
97
|
dados?: Record<string, unknown> | null
|
|
96
98
|
conversationId?: string
|
|
99
|
+
/** A retomada tambem chama o modelo: vale o mesmo nivel do envio. */
|
|
100
|
+
esforco?: Esforco
|
|
97
101
|
signal?: AbortSignal
|
|
98
102
|
onEvent: (evento: ChatEvent) => void
|
|
99
103
|
}
|
|
@@ -107,12 +111,13 @@ export type ResumeChatParams = {
|
|
|
107
111
|
export async function streamChat({
|
|
108
112
|
prompt,
|
|
109
113
|
conversationId,
|
|
114
|
+
esforco,
|
|
110
115
|
signal,
|
|
111
116
|
onEvent,
|
|
112
117
|
}: StreamChatParams): Promise<void> {
|
|
113
118
|
await postarEConsumir(
|
|
114
119
|
'/ai/chat/stream',
|
|
115
|
-
{ prompt, conversation_id: conversationId },
|
|
120
|
+
{ prompt, conversation_id: conversationId, esforco },
|
|
116
121
|
onEvent,
|
|
117
122
|
signal,
|
|
118
123
|
)
|
|
@@ -131,12 +136,13 @@ export async function resumeChat({
|
|
|
131
136
|
approved,
|
|
132
137
|
dados,
|
|
133
138
|
conversationId,
|
|
139
|
+
esforco,
|
|
134
140
|
signal,
|
|
135
141
|
onEvent,
|
|
136
142
|
}: ResumeChatParams): Promise<void> {
|
|
137
143
|
await postarEConsumir(
|
|
138
144
|
'/ai/chat/resume',
|
|
139
|
-
{ approved, dados, conversation_id: conversationId },
|
|
145
|
+
{ approved, dados, conversation_id: conversationId, esforco },
|
|
140
146
|
onEvent,
|
|
141
147
|
signal,
|
|
142
148
|
)
|
|
@@ -12,6 +12,7 @@ import AiErrorMessage from './AiErrorMessage'
|
|
|
12
12
|
import ToolCallChip from './ToolCallChip'
|
|
13
13
|
import ApprovalCard from './ApprovalCard'
|
|
14
14
|
import DataRequestCard from './DataRequestCard'
|
|
15
|
+
import EsforcoRaciocinio from './EsforcoRaciocinio'
|
|
15
16
|
import { usGenerativeChatStore } from '../store/generativeChatStore'
|
|
16
17
|
import useChatSend from '../hooks/useChatSend'
|
|
17
18
|
import useConversationMessages from '../hooks/useConversationMessages'
|
|
@@ -40,9 +41,17 @@ type ChatViewProps = {
|
|
|
40
41
|
* flutuante desliga, porque tem o próprio drawer dentro do painel.
|
|
41
42
|
*/
|
|
42
43
|
showMobileNav?: boolean
|
|
44
|
+
/**
|
|
45
|
+
* Classes dos menus flutuantes do chat. O widget passa um z-index acima do
|
|
46
|
+
* próprio painel; sem isso o menu abriria atrás dele.
|
|
47
|
+
*/
|
|
48
|
+
dropdownFloatingClass?: string
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
const ChatView = ({
|
|
51
|
+
const ChatView = ({
|
|
52
|
+
showMobileNav = true,
|
|
53
|
+
dropdownFloatingClass,
|
|
54
|
+
}: ChatViewProps) => {
|
|
46
55
|
const scrollRef = useRef<ScrollBarRef>(null)
|
|
47
56
|
const { selectedConversation, chatHistory, isTyping, disabledChatFresh } =
|
|
48
57
|
usGenerativeChatStore()
|
|
@@ -226,6 +235,9 @@ const ChatView = ({ showMobileNav = true }: ChatViewProps) => {
|
|
|
226
235
|
return null
|
|
227
236
|
}}
|
|
228
237
|
onInputChange={handleInputChange}
|
|
238
|
+
inputActions={
|
|
239
|
+
<EsforcoRaciocinio floatingClass={dropdownFloatingClass} />
|
|
240
|
+
}
|
|
229
241
|
>
|
|
230
242
|
{/* Os children ficam entre a lista e o input: sem conversa e a
|
|
231
243
|
landing com os cards; com conversa, o aviso sobre a IA. */}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { TbBrain, TbCheck, TbChevronDown } from 'react-icons/tb'
|
|
2
|
+
import Dropdown from '@/components/ui/Dropdown'
|
|
3
|
+
import { useEsforcoStore } from '../store/esforcoStore'
|
|
4
|
+
import type { Esforco } from '../types'
|
|
5
|
+
|
|
6
|
+
type NivelDeEsforco = {
|
|
7
|
+
valor: Esforco
|
|
8
|
+
rotulo: string
|
|
9
|
+
descricao: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Os níveis, do menor para o maior raciocínio. Servem o botão e o menu. */
|
|
13
|
+
const NIVEIS: ReadonlyArray<NivelDeEsforco> = [
|
|
14
|
+
{
|
|
15
|
+
valor: 'minimal',
|
|
16
|
+
rotulo: 'Mínimo',
|
|
17
|
+
descricao: 'Mais rápido, para consultas diretas.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
valor: 'medium',
|
|
21
|
+
rotulo: 'Médio',
|
|
22
|
+
descricao: 'Equilíbrio entre rapidez e cuidado. Recomendado.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
valor: 'high',
|
|
26
|
+
rotulo: 'Alto',
|
|
27
|
+
descricao: 'Pensa mais antes de responder; bom para análises.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
valor: 'max',
|
|
31
|
+
rotulo: 'Máximo',
|
|
32
|
+
descricao: 'Pensa o máximo possível antes de responder.',
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
/** O `eventKey` do Dropdown é `string`; só um dos níveis acima é aceito. */
|
|
37
|
+
const ehEsforco = (valor: string): valor is Esforco =>
|
|
38
|
+
NIVEIS.some((nivel) => nivel.valor === valor)
|
|
39
|
+
|
|
40
|
+
type EsforcoRaciocinioProps = {
|
|
41
|
+
/** Classes do menu flutuante; o widget passa um z-index acima do painel. */
|
|
42
|
+
floatingClass?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Seletor do nível de raciocínio, dentro da caixa de mensagem.
|
|
47
|
+
*
|
|
48
|
+
* O botão mostra o nível atual; o menu abre para cima, com uma linha
|
|
49
|
+
* explicando cada nível. A escolha vale para as próximas mensagens (e para as
|
|
50
|
+
* retomadas de aprovação e de formulário); as respostas já dadas não mudam.
|
|
51
|
+
*/
|
|
52
|
+
const EsforcoRaciocinio = ({ floatingClass }: EsforcoRaciocinioProps) => {
|
|
53
|
+
const { esforco, setEsforco } = useEsforcoStore()
|
|
54
|
+
const atual = NIVEIS.find((nivel) => nivel.valor === esforco)
|
|
55
|
+
|
|
56
|
+
const handleSelect = (valor: string) => {
|
|
57
|
+
if (ehEsforco(valor)) {
|
|
58
|
+
setEsforco(valor)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Dropdown
|
|
64
|
+
placement="top-end"
|
|
65
|
+
activeKey={esforco}
|
|
66
|
+
menuClass="w-72"
|
|
67
|
+
floatingClass={floatingClass}
|
|
68
|
+
renderTitle={
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
aria-label={`Nível de raciocínio: ${atual?.rotulo}`}
|
|
72
|
+
className="flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-semibold text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-100"
|
|
73
|
+
>
|
|
74
|
+
<TbBrain className="text-base" />
|
|
75
|
+
<span>{atual?.rotulo}</span>
|
|
76
|
+
<TbChevronDown />
|
|
77
|
+
</button>
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
<Dropdown.Item variant="header">
|
|
81
|
+
<div className="px-3 pb-2">
|
|
82
|
+
<div className="heading-text text-sm font-bold">
|
|
83
|
+
Raciocínio
|
|
84
|
+
</div>
|
|
85
|
+
<div className="text-xs text-gray-500 dark:text-gray-400">
|
|
86
|
+
Quanto o assistente pensa antes de responder.
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</Dropdown.Item>
|
|
90
|
+
{NIVEIS.map((nivel) => (
|
|
91
|
+
<Dropdown.Item
|
|
92
|
+
key={nivel.valor}
|
|
93
|
+
eventKey={nivel.valor}
|
|
94
|
+
onSelect={handleSelect}
|
|
95
|
+
// O MenuItem fixa 42px de altura e `nowrap`, feitos para
|
|
96
|
+
// uma linha; aqui cada item tem título e descrição.
|
|
97
|
+
style={{ height: 'auto' }}
|
|
98
|
+
className="items-start whitespace-normal py-2"
|
|
99
|
+
>
|
|
100
|
+
<div className="flex-1">
|
|
101
|
+
<div>{nivel.rotulo}</div>
|
|
102
|
+
<div className="text-xs font-normal text-gray-500 dark:text-gray-400">
|
|
103
|
+
{nivel.descricao}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
{nivel.valor === esforco && (
|
|
107
|
+
<TbCheck className="mt-0.5 shrink-0 text-lg" />
|
|
108
|
+
)}
|
|
109
|
+
</Dropdown.Item>
|
|
110
|
+
))}
|
|
111
|
+
</Dropdown>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default EsforcoRaciocinio
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { usGenerativeChatStore } from '../store/generativeChatStore'
|
|
2
|
+
import { useEsforcoStore } from '../store/esforcoStore'
|
|
2
3
|
import { resumeChat, streamChat } from '@/services/AiService'
|
|
3
4
|
import { useAuth } from '@/auth'
|
|
4
5
|
import dayjs from 'dayjs'
|
|
@@ -20,6 +21,8 @@ const useChatSend = () => {
|
|
|
20
21
|
updateConversation,
|
|
21
22
|
setIsTyping,
|
|
22
23
|
} = usGenerativeChatStore()
|
|
24
|
+
// Vai em toda ida ao modelo: envio, aprovação e formulário.
|
|
25
|
+
const esforco = useEsforcoStore((state) => state.esforco)
|
|
23
26
|
|
|
24
27
|
const creteMyMessage = (id: string, prompt: string) => {
|
|
25
28
|
pushConversation(id, {
|
|
@@ -194,7 +197,13 @@ const useChatSend = () => {
|
|
|
194
197
|
await consumirStream(
|
|
195
198
|
chatId,
|
|
196
199
|
messageId,
|
|
197
|
-
(onEvent) =>
|
|
200
|
+
(onEvent) =>
|
|
201
|
+
streamChat({
|
|
202
|
+
prompt,
|
|
203
|
+
conversationId: chatId,
|
|
204
|
+
esforco,
|
|
205
|
+
onEvent,
|
|
206
|
+
}),
|
|
198
207
|
{ texto: '', tools: [] },
|
|
199
208
|
)
|
|
200
209
|
}
|
|
@@ -253,7 +262,12 @@ const useChatSend = () => {
|
|
|
253
262
|
chatId,
|
|
254
263
|
messageId,
|
|
255
264
|
(onEvent) =>
|
|
256
|
-
resumeChat({
|
|
265
|
+
resumeChat({
|
|
266
|
+
approved,
|
|
267
|
+
conversationId: chatId,
|
|
268
|
+
esforco,
|
|
269
|
+
onEvent,
|
|
270
|
+
}),
|
|
257
271
|
{ texto: mensagem.content ?? '', tools: mensagem.tools ?? [] },
|
|
258
272
|
)
|
|
259
273
|
}
|
|
@@ -286,7 +300,8 @@ const useChatSend = () => {
|
|
|
286
300
|
await consumirStream(
|
|
287
301
|
chatId,
|
|
288
302
|
messageId,
|
|
289
|
-
(onEvent) =>
|
|
303
|
+
(onEvent) =>
|
|
304
|
+
resumeChat({ dados, conversationId: chatId, esforco, onEvent }),
|
|
290
305
|
{ texto: mensagem.content ?? '', tools: mensagem.tools ?? [] },
|
|
291
306
|
)
|
|
292
307
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { create } from 'zustand'
|
|
2
|
+
import { persist } from 'zustand/middleware'
|
|
3
|
+
import type { Esforco } from '../types'
|
|
4
|
+
|
|
5
|
+
type EsforcoState = {
|
|
6
|
+
esforco: Esforco
|
|
7
|
+
setEsforco: (payload: Esforco) => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Nível de raciocínio escolhido no chat.
|
|
12
|
+
*
|
|
13
|
+
* Persistido no navegador, como tema e idioma: é preferência de uso, não dado
|
|
14
|
+
* da conversa. Por isso mora fora do `generativeChatStore`, que não persiste e
|
|
15
|
+
* é zerado quando o usuário da sessão muda.
|
|
16
|
+
*/
|
|
17
|
+
export const useEsforcoStore = create<EsforcoState>()(
|
|
18
|
+
persist(
|
|
19
|
+
(set) => ({
|
|
20
|
+
esforco: 'medium',
|
|
21
|
+
setEsforco: (payload) => set(() => ({ esforco: payload })),
|
|
22
|
+
}),
|
|
23
|
+
{ name: 'orbe-ai-esforco' },
|
|
24
|
+
),
|
|
25
|
+
)
|
|
@@ -179,6 +179,14 @@ export type HistoryChat = Omit<ChatHistory, 'conversation'> & {
|
|
|
179
179
|
conversation: HistoryMessage[]
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Nível de raciocínio do modelo, escolhido no chat e enviado em cada mensagem.
|
|
184
|
+
*
|
|
185
|
+
* Os valores são os do OpenRouter, sem tradução — o backend valida contra o
|
|
186
|
+
* mesmo conjunto (enum `Esforco`) e responde 422 para qualquer outro.
|
|
187
|
+
*/
|
|
188
|
+
export type Esforco = 'minimal' | 'medium' | 'high' | 'max'
|
|
189
|
+
|
|
182
190
|
/** Resumo de uma conversa, como vem do GET /ai/chat/conversations. */
|
|
183
191
|
export type ConversationSummary = {
|
|
184
192
|
id: string
|
|
@@ -59,10 +59,13 @@ export async function apiFindMonitorRacaoCarga(body?: IFilterParams) {
|
|
|
59
59
|
})
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export async function apiFindOrdensDisponiveisRacaoCarga(vendedorId: number, centroId: number, incotermsId: number) {
|
|
62
|
+
export async function apiFindOrdensDisponiveisRacaoCarga(vendedorId: number, centroId: number, incotermsId: number, vendedoresDivisaoIds: number[] = []) {
|
|
63
63
|
return ApiService.fetchDataWithAxios<TQueryResponse<TCarga>>({
|
|
64
64
|
url: CARGA_ENDPOINT.findOrdensDisponiveis.endpoint + `${vendedorId}/` + `${centroId}/` + `${incotermsId}`,
|
|
65
65
|
method: CARGA_ENDPOINT.findOrdensDisponiveis.method,
|
|
66
|
+
params: {
|
|
67
|
+
...(vendedoresDivisaoIds.length > 0 && { vendedoresDivisaoIds: vendedoresDivisaoIds.join(',') }),
|
|
68
|
+
},
|
|
66
69
|
})
|
|
67
70
|
}
|
|
68
71
|
|
package/package.json
CHANGED