csc-cia-stne 0.1.39__tar.gz → 0.1.41__tar.gz

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.
Files changed (54) hide show
  1. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/PKG-INFO +1 -1
  2. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/pyproject.toml +1 -1
  3. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/jerry.py +14 -4
  4. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/GcpBigQueryValidator.py +6 -11
  5. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne.egg-info/PKG-INFO +1 -1
  6. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/LICENCE +0 -0
  7. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/README.md +0 -0
  8. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/README_PYPI.md +0 -0
  9. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/setup.cfg +0 -0
  10. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/__init__.py +0 -0
  11. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/bc_correios.py +0 -0
  12. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/bc_sta.py +0 -0
  13. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/email.py +0 -0
  14. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/ftp.py +0 -0
  15. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/gcp_bigquery.py +0 -0
  16. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/gcp_bucket.py +0 -0
  17. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/gcp_document_ai.py +0 -0
  18. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/google_drive.py +0 -0
  19. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/karavela.py +0 -0
  20. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/logger_json.py +0 -0
  21. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/logger_rich.py +0 -0
  22. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/provio.py +0 -0
  23. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/servicenow.py +0 -0
  24. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/slack.py +0 -0
  25. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/stne_admin.py +0 -0
  26. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/__init__.py +0 -0
  27. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/__init__.py +0 -0
  28. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_b64.py +0 -0
  29. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_converters.py +0 -0
  30. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_datetime.py +0 -0
  31. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_delete.py +0 -0
  32. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_get_secret.py +0 -0
  33. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_pdf_extract.py +0 -0
  34. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_recriar_pastas.py +0 -0
  35. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_settings.py +0 -0
  36. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_titulo.py +0 -0
  37. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/functions/func_validate_json.py +0 -0
  38. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/GoogleDriveValidator.py +0 -0
  39. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/ServiceNowValidator.py +0 -0
  40. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/__init__.py +0 -0
  41. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/ftp.py +0 -0
  42. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/gcp_bucket.py +0 -0
  43. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/waccess.py +0 -0
  44. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/validations/web_validator.py +0 -0
  45. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/web_screen/__init__.py +0 -0
  46. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/web_screen/web_screen_abstract.py +0 -0
  47. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/web_screen/web_screen_botcity.py +0 -0
  48. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/utilitarios/web_screen/web_screen_selenium.py +0 -0
  49. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/wacess.py +0 -0
  50. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne/web.py +0 -0
  51. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne.egg-info/SOURCES.txt +0 -0
  52. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne.egg-info/dependency_links.txt +0 -0
  53. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne.egg-info/requires.txt +0 -0
  54. {csc_cia_stne-0.1.39 → csc_cia_stne-0.1.41}/src/csc_cia_stne.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csc_cia_stne
3
- Version: 0.1.39
3
+ Version: 0.1.41
4
4
  Summary: Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs
5
5
  License: MIT
6
6
  Keywords: karavela,csc,cia,stone,rpa,botcity,stne
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "csc_cia_stne"
7
- version = "0.1.39"
7
+ version = "0.1.41"
8
8
  license = { text = "MIT" }
9
9
  description = "Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs"
10
10
  keywords = ["karavela", "csc", "cia", "stone", "rpa", "botcity", "stne"]
@@ -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) -> Dict[str, Any]:
180
180
  """
181
181
  Envia prompts e opcionalmente múltiplas imagens para a IA via Databricks.
182
182
 
@@ -190,6 +190,8 @@ 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
193
195
 
194
196
  Tipos de imagem suportados:
195
197
  ✅ image/jpeg, image/jpg, image/png, image/gif, image/webp, image/bmp, image/tiff
@@ -461,7 +463,13 @@ class JerryClient:
461
463
  "images_validated": images_stats
462
464
  }
463
465
 
464
- # 4. REQUISIÇÃO PARA O DATABRICKS
466
+ # 4. PREPARAÇÃO E ENVIO COM TOOLS (SE FORNECIDO)
467
+ if tools:
468
+ self.log.info(f"{jerry_prompt}🔧 Ferramentas fornecidas para a IA:")
469
+ for tool in tools:
470
+ self.log.info(f"{jerry_prompt} - {tool['function']['name']}: {tool['function']['description']}")
471
+
472
+ # 5. REQUISIÇÃO PARA O DATABRICKS
465
473
  max_retries = 3
466
474
  for attempt in range(max_retries):
467
475
  try:
@@ -497,7 +505,9 @@ class JerryClient:
497
505
  self.log.info(f"{jerry_prompt}🚀 Enviando para Databricks (modelo: {self.ia_model})...")
498
506
  response = self.client.chat.completions.create(
499
507
  model=self.ia_model,
500
- messages=messages
508
+ tools=tools,
509
+ temperature=temperature,
510
+ messages=messages,
501
511
  )
502
512
 
503
513
  # ✅ SUCESSO
@@ -506,7 +516,7 @@ class JerryClient:
506
516
  self.log.info(f"{jerry_prompt}📄 Resposta bruta: {json.dumps(response.model_dump(), ensure_ascii=False)}")
507
517
 
508
518
  content_processado = response.model_dump()
509
- content_processado = content_processado["choices"][0]["message"]["content"]
519
+ #content_processado = content_processado["choices"][0]["message"]["content"]
510
520
 
511
521
  return {
512
522
  "success": True,
@@ -20,18 +20,13 @@ class InitParamsValidator(BaseModel):
20
20
  return value
21
21
 
22
22
  @model_validator(mode="after")
23
- def check_others_input(cls, model):
24
- creds_dict = model.creds_dict
25
- creds_file = model.creds_file
23
+ def check_others_input(self):
24
+ creds_dict = isinstance(self.creds_dict, dict)
25
+ creds_file = isinstance(self.creds_file, str)
26
26
 
27
- if isinstance(creds_dict, dict):
28
- return model
29
-
30
- elif isinstance(creds_file, str) and creds_file.strip():
31
- return model
32
-
33
- else:
34
- raise ValueError("Pelo menos um dos parâmetros 'creds_dict' ou 'creds_file' deve ser fornecido.")
27
+ if not creds_dict and not creds_file:
28
+ raise ValueError("É necessário fornecer 'creds_dict' ou 'creds_file' para autenticação")
29
+ return self
35
30
 
36
31
 
37
32
  class tryQueryValidator(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csc_cia_stne
3
- Version: 0.1.39
3
+ Version: 0.1.41
4
4
  Summary: Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs
5
5
  License: MIT
6
6
  Keywords: karavela,csc,cia,stone,rpa,botcity,stne
File without changes
File without changes
File without changes