from openai import OpenAI # Initialize client pointing to your local server client = OpenAI(base_url="http://localhost:8081/v1", api_key="no-key-required") # messages = [ # { # "role": "user", # "content": "Translate the following text from English to Bengali:\n\nA 20-year-old woman was followed up since the age of eight for idiopathic NS inaugurated by cerebral venous thrombosis extended to the right jugular vein with a massive pulmonary embolism. The patient did not have any sequelae. She had no other medical or surgical history. A family history of thrombosis has not been reported. The patient was not biopsied because she had no kidney failure nor gross hematuria, or hypertension at first presentation; added to that, she had no extra renal signs suggestive of a secondary nephrotic syndrome. She was accordingly put on anticoagulant therapy (Oral vitamin K antagonist) and oral corticosteroid therapy with good evolution. Thereafter, the patient received several cures of high-dose corticosteroids for steroid-dependent relapses of NS. She was, hence, put on mycophenolate mofetil (MMF) as a background therapy to avoid corticosteroids and ensure normal growth. An exhaustive assessment of thrombophilia was performed and did not show any abnormality. Homocysteine rate, blood fibrinogen rate, Protein C, protein S, antithrombin III, factor V Leiden mutation, JAK-2 mutation, cryoglobulins, anticardiolipin antibodies, lupus anticoagulant and beta-1-glycoprotein antibodies were normal. The anticoagulant treatment was stopped after nine years. The evolution was enameled by the occurrence of several relapses of her disease controlled by oral corticosteroid therapy. Remission of NS has been noted since 2017, so MMF was gradually stopped in 2019 and the patient remained asymptomatic and without any relapse.\n\nOne year later, the patient came up to our emergency department for acute intense diffuse abdominal pain without any particular irradiation associated with postprandial vomiting and bilateral lower limb edema for the last six hours. The physical examination revealed an intense epigastric tenderness with normal vital signs (arterial pressure of 120/70 mm Hg, heart rate of 83 bpm, and oxygen saturation at 100% on room air). The patient was afebrile with normal consciousness. The rest of the physical examination was unremarkable. The urinalysis with labstix revealed proteinuria. The hemogasanalysis results showed metabolic acidosis with respiratory compensation. Further laboratory tests revealed hypoalbuminemia, hypercholesterolemia, a prothrombin time at 90%, high levels of D-dimer, lactate dehydrogenase, and creatine phosphokinase as well as a biological inflammatory syndrome with a CRP of 37 mg/L, and leucocytosis at 26.4 x 103/µL. Renal and liver functions were normal.\n\nThe patient was hospitalized in an intensive care unit with close monitoring of vital signs and initiation of resuscitation measures. An abdominal ultrasound was performed urgently showing an intra-abdominal effusion of low to moderate abundance. An abdominal CT scan revealed acute thrombosis of the superior mesenteric artery with acute mesenteric ischemia. The patient was immediately routed to the operating room. Intraoperative exploration confirmed mesenteric ischemia with extensive necrosis of almost entirely of the small bowel making their resections incompatible with life shown in Figure 3. The patient died after 48 hours." # } # ] messages = [ { "role": "user", "content": [ { "type": "text", "source_lang_code": "cs", "target_lang_code": "de-DE", "text": "V nejhorším případě i k prasknutí čočky.", } ], } ] completion = client.chat.completions.create( model="translate_gemma", messages=messages, stream=False ) print(completion.choices[0].message.content) # for chunk in completion: # if chunk.choices[0].delta.content: # print(chunk.choices[0].delta.content, end="", flush=True) # print()