yta-fastapi-docker-api 0.0.3__tar.gz → 0.0.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yta-fastapi-docker-api
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Youtube Autonomous FastAPI Docker API Module
5
5
  License-File: LICENSE
6
6
  Author: danialcala94
@@ -46,13 +46,15 @@ You can replace the `{id_video}` with this id `e_YBmIxeyUg` for testing.
46
46
  #### POST
47
47
  No endpoints available
48
48
 
49
- ### Ollama
49
+ ### Llama.cpp
50
50
 
51
51
  #### GET
52
52
  No endpoints available
53
53
 
54
54
  #### POST
55
- No endpoints available
55
+ - `/llamacpp/gemma4`
56
+ - `prompt` - The prompt we want to give
57
+ - `output_schema` - The schema we want as the output
56
58
 
57
59
  ### VibeVoice
58
60
 
@@ -25,13 +25,15 @@ You can replace the `{id_video}` with this id `e_YBmIxeyUg` for testing.
25
25
  #### POST
26
26
  No endpoints available
27
27
 
28
- ### Ollama
28
+ ### Llama.cpp
29
29
 
30
30
  #### GET
31
31
  No endpoints available
32
32
 
33
33
  #### POST
34
- No endpoints available
34
+ - `/llamacpp/gemma4`
35
+ - `prompt` - The prompt we want to give
36
+ - `output_schema` - The schema we want as the output
35
37
 
36
38
  ### VibeVoice
37
39
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "yta-fastapi-docker-api"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  description = "Youtube Autonomous FastAPI Docker API Module"
5
5
  authors = [
6
6
  {name = "danialcala94", email = "danielalcalavalera@gmail.com"}
@@ -1,148 +0,0 @@
1
- # from yta_fastapi_docker_pydantic_models.ollama import Prompt
2
- # from yta_fastapi_docker_common import proxy_stream_endpoint
3
- # from yta_programming_env import Environment
4
- # from yta_httpx.client import HttpClient
5
- # from fastapi import APIRouter
6
- # from fastapi.responses import JSONResponse, Response
7
-
8
-
9
- # CONTAINER_API_ENDPOINT_URL = Environment.get_env('OLLAMA_DOCKER_ENDPOINT')
10
- # PREFIX = f'/ollama'
11
-
12
- # router = APIRouter(
13
- # prefix = PREFIX
14
- # )
15
-
16
- # """
17
- # TODO: The 'prompt' is a class in the 'yta_fastapi_docker_ollama'
18
- # but I don't want to duplicate code and I'm not importing
19
- # any module to be able to bring it here...
20
- # """
21
-
22
- # @router.post('/gemma4')
23
- # async def post_ollama_gemma4(
24
- # prompt_system: Prompt,
25
- # prompt: Prompt
26
- # ) -> 'StreamingResponse':
27
- # endpoint_url = f'{CONTAINER_API_ENDPOINT_URL}/ollama/gemma4'
28
-
29
- # payload = {
30
- # 'prompt_system': prompt_system.model_dump(),
31
- # 'prompt': prompt.model_dump()
32
- # }
33
-
34
- # return await proxy_stream_endpoint(
35
- # url = endpoint_url,
36
- # method = 'POST',
37
- # json = payload,
38
- # do_close_response = True,
39
- # do_close_client = True
40
- # )
41
-
42
- # @router.post('/agents/transcription-cleaner')
43
- # async def post_ollama_agents_transcription_cleaner(
44
- # prompt: Prompt
45
- # ) -> 'StreamingResponse':
46
- # endpoint_url = f'{CONTAINER_API_ENDPOINT_URL}/ollama/agents/transcription-cleaner'
47
-
48
- # # This below if pydantic v2
49
- # payload = prompt.model_dump()
50
- # # This below if pydantic v1
51
- # # payload = request.dict()
52
-
53
- # return await proxy_stream_endpoint(
54
- # url = endpoint_url,
55
- # method = 'POST',
56
- # json = payload,
57
- # do_close_response = True,
58
- # do_close_client = True
59
- # )
60
-
61
- # async with HttpClient(...) as http_client:
62
- # response = await http_client.post.stream(
63
- # url = endpoint_url,
64
- # json = payload
65
- # )
66
-
67
- # excluded_headers = {
68
- # "content-length",
69
- # "transfer-encoding",
70
- # "connection",
71
- # "content-encoding"
72
- # }
73
-
74
- # headers = {
75
- # k: v for k, v in response.headers.items()
76
- # if k.lower() not in excluded_headers
77
- # }
78
-
79
- # # TODO: We need to handle errors that are not JSON
80
- # content_type = resp.headers.get("content-type")
81
-
82
- # if "application/json" in content_type:
83
- # return JSONResponse(
84
- # content = resp.json(),
85
- # status_code = resp.status_code,
86
- # headers = headers
87
- # )
88
-
89
- # """
90
- # If I don't have the model it is just returning an
91
- # 'Internal Server Error' message, but not that we
92
- # don't have the specific model...
93
- # """
94
- # return Response(
95
- # # bytes (?)
96
- # content = resp.content,
97
- # status_code = resp.status_code,
98
- # media_type = resp.headers.get("content-type"),
99
- # headers = headers
100
- # )
101
-
102
- # """
103
- # This method below was not using the pydantic model
104
- # but was working correctly. Leave it here until the
105
- # one with the model is working.
106
- # """
107
- # # @router.post('/agents/transcription-cleaner')
108
- # # def get_agents_transcription_cleaner(
109
- # # # prompt: Prompt
110
- # # # prompt: str
111
- # # payload: dict = Body(...)
112
- # # ) -> JSONResponse:
113
- # # print('---')
114
- # # print(payload)
115
- # # print('---')
116
- # # response = requests.post(
117
- # # url = f'{OLLAMA_URL}/ollama/agents/transcription-cleaner',
118
- # # json = payload
119
- # # )
120
- # # print('@@@')
121
- # # print(response)
122
- # # print('@@@')
123
-
124
- # # content_type = response.headers.get("content-type", "")
125
-
126
- # # if "application/json" in content_type:
127
- # # return JSONResponse(
128
- # # content = response.json(),
129
- # # status_code = response.status_code
130
- # # )
131
-
132
- # # """
133
- # # If I don't have the model it is just returning an
134
- # # 'Internal Server Error' message, but not that we
135
- # # don't have the specific model...
136
- # # """
137
- # # # TODO:
138
- # # return Response(
139
- # # # bytes (?)
140
- # # content = response.content,
141
- # # status_code = response.status_code,
142
- # # media_type = response.headers.get("content-type")
143
- # # )
144
-
145
- # # return JSONResponse(
146
- # # content = response.json(),
147
- # # status_code = response.status_code
148
- # # )