csc-cia-stne 0.1.40__py3-none-any.whl → 0.1.42__py3-none-any.whl
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.
- csc_cia_stne/jerry.py +16 -4
- {csc_cia_stne-0.1.40.dist-info → csc_cia_stne-0.1.42.dist-info}/METADATA +1 -1
- {csc_cia_stne-0.1.40.dist-info → csc_cia_stne-0.1.42.dist-info}/RECORD +6 -6
- {csc_cia_stne-0.1.40.dist-info → csc_cia_stne-0.1.42.dist-info}/WHEEL +0 -0
- {csc_cia_stne-0.1.40.dist-info → csc_cia_stne-0.1.42.dist-info}/licenses/LICENCE +0 -0
- {csc_cia_stne-0.1.40.dist-info → csc_cia_stne-0.1.42.dist-info}/top_level.txt +0 -0
csc_cia_stne/jerry.py
CHANGED
|
@@ -176,7 +176,7 @@ class JerryClient:
|
|
|
176
176
|
self.error = f"Erro na autenticação: {e}"
|
|
177
177
|
return None
|
|
178
178
|
|
|
179
|
-
def v1_enviar_para_ia(self, system_prompt: str, user_prompt: str, arquivos: Optional[List[Dict[str, str]]] = None) -> Dict[str, Any]:
|
|
179
|
+
def v1_enviar_para_ia(self, system_prompt: str, user_prompt: str, arquivos: Optional[List[Dict[str, str]]] = None, tools: Optional[List[Dict[str, Any]]] = None, temperature: float = 0.3, tool_choice: Optional[str] = None) -> Dict[str, Any]:
|
|
180
180
|
"""
|
|
181
181
|
Envia prompts e opcionalmente múltiplas imagens para a IA via Databricks.
|
|
182
182
|
|
|
@@ -190,6 +190,9 @@ class JerryClient:
|
|
|
190
190
|
- mime_type: Tipo MIME da imagem (deve ser image/*)
|
|
191
191
|
- name: Nome/descrição da imagem (opcional, para logs)
|
|
192
192
|
- file_path: Caminho original da imagem (opcional, para logs)
|
|
193
|
+
temperature (float): Temperatura para a geração de texto (default = 0.3)
|
|
194
|
+
tools (Optional[List[Dict[str, Any]]]): Lista de ferramentas (tools) para fornecer à IA
|
|
195
|
+
tool_choice (Optional[str]): required, auto
|
|
193
196
|
|
|
194
197
|
Tipos de imagem suportados:
|
|
195
198
|
✅ image/jpeg, image/jpg, image/png, image/gif, image/webp, image/bmp, image/tiff
|
|
@@ -461,7 +464,13 @@ class JerryClient:
|
|
|
461
464
|
"images_validated": images_stats
|
|
462
465
|
}
|
|
463
466
|
|
|
464
|
-
# 4.
|
|
467
|
+
# 4. PREPARAÇÃO E ENVIO COM TOOLS (SE FORNECIDO)
|
|
468
|
+
if tools:
|
|
469
|
+
self.log.info(f"{jerry_prompt}🔧 Ferramentas fornecidas para a IA:")
|
|
470
|
+
for tool in tools:
|
|
471
|
+
self.log.info(f"{jerry_prompt} - {tool['function']['name']}: {tool['function']['description']}")
|
|
472
|
+
|
|
473
|
+
# 5. REQUISIÇÃO PARA O DATABRICKS
|
|
465
474
|
max_retries = 3
|
|
466
475
|
for attempt in range(max_retries):
|
|
467
476
|
try:
|
|
@@ -497,7 +506,10 @@ class JerryClient:
|
|
|
497
506
|
self.log.info(f"{jerry_prompt}🚀 Enviando para Databricks (modelo: {self.ia_model})...")
|
|
498
507
|
response = self.client.chat.completions.create(
|
|
499
508
|
model=self.ia_model,
|
|
500
|
-
|
|
509
|
+
tools=tools,
|
|
510
|
+
tool_choice=tool_choice,
|
|
511
|
+
temperature=temperature,
|
|
512
|
+
messages=messages,
|
|
501
513
|
)
|
|
502
514
|
|
|
503
515
|
# ✅ SUCESSO
|
|
@@ -506,7 +518,7 @@ class JerryClient:
|
|
|
506
518
|
self.log.info(f"{jerry_prompt}📄 Resposta bruta: {json.dumps(response.model_dump(), ensure_ascii=False)}")
|
|
507
519
|
|
|
508
520
|
content_processado = response.model_dump()
|
|
509
|
-
content_processado = content_processado["choices"][0]["message"]["content"]
|
|
521
|
+
#content_processado = content_processado["choices"][0]["message"]["content"]
|
|
510
522
|
|
|
511
523
|
return {
|
|
512
524
|
"success": True,
|
|
@@ -7,7 +7,7 @@ csc_cia_stne/gcp_bigquery.py,sha256=foq8azvvv_f7uikMDslX9RcUIrx7RAS-Sn0AGW0QFQc,
|
|
|
7
7
|
csc_cia_stne/gcp_bucket.py,sha256=vMALWiW7IoBCuJAR8bUCpOV6BuBzI9AhRRk3b72OdMk,11515
|
|
8
8
|
csc_cia_stne/gcp_document_ai.py,sha256=Dzlk7YR3M_LxE0sHn-Lxz-PA1NsUZN2hgY5PyUfs0IQ,4506
|
|
9
9
|
csc_cia_stne/google_drive.py,sha256=7qwx4_RPEoSJgeVI02aLYNXA7o69_Z3qONvX5bfA4V0,44500
|
|
10
|
-
csc_cia_stne/jerry.py,sha256=
|
|
10
|
+
csc_cia_stne/jerry.py,sha256=Bmu0A35tLPVBVHbjnwJkit4W-yZpOaWB5hG80E5f_gk,28587
|
|
11
11
|
csc_cia_stne/karavela.py,sha256=jJCYX43D49gGuzmwwK6bN9XVnv2dXdp9iHnnV5H1LMQ,4794
|
|
12
12
|
csc_cia_stne/logger_json.py,sha256=CXxSCOFGMymDi8XE9SKnPKjW4D0wJLqDLnxqePS26i8,3187
|
|
13
13
|
csc_cia_stne/logger_rich.py,sha256=fklgkBb4rblKQd7YZ3q-eWfhGg9eflO2k2-z4pGh_yo,5201
|
|
@@ -41,8 +41,8 @@ csc_cia_stne/utilitarios/web_screen/__init__.py,sha256=5QcOPXKd95SvP2DoZiHS0gaU6
|
|
|
41
41
|
csc_cia_stne/utilitarios/web_screen/web_screen_abstract.py,sha256=PjL8Vgfj_JdKidia7RFyCkro3avYLQu4RZRos41sh3w,3241
|
|
42
42
|
csc_cia_stne/utilitarios/web_screen/web_screen_botcity.py,sha256=Xi5YJjl2pcxlX3OimqcBWRNXZEpAE7asyUjDJ4Oho5U,12297
|
|
43
43
|
csc_cia_stne/utilitarios/web_screen/web_screen_selenium.py,sha256=JLIcPJE9ZX3Pd6zG6oTRMqqUAY063UzLY3ReRlxmiSM,15581
|
|
44
|
-
csc_cia_stne-0.1.
|
|
45
|
-
csc_cia_stne-0.1.
|
|
46
|
-
csc_cia_stne-0.1.
|
|
47
|
-
csc_cia_stne-0.1.
|
|
48
|
-
csc_cia_stne-0.1.
|
|
44
|
+
csc_cia_stne-0.1.42.dist-info/licenses/LICENCE,sha256=LPGMtgKki2C3KEZP7hDhA1HBrlq5JCHkIeStUCLEMx4,1073
|
|
45
|
+
csc_cia_stne-0.1.42.dist-info/METADATA,sha256=_4_CSj4MqzkzQD-sQ4s4o48vF1JgVZCn_z4N2fhh46g,1574
|
|
46
|
+
csc_cia_stne-0.1.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
csc_cia_stne-0.1.42.dist-info/top_level.txt,sha256=ldo7GVv3tQx5KJvwBzdZzzQmjPys2NDVVn1rv0BOF2Q,13
|
|
48
|
+
csc_cia_stne-0.1.42.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|