xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
62.22k stars 13.39k forks source link

G4F returns truncated result #2405

Closed microcoder closed 2 days ago

microcoder commented 3 days ago

Bug description G4F returns truncated incomplete result.

Run example code:

from g4f.client import Client

client = Client(provider='ChatGptEs')

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "role": "user",
            "content": "To generate 50 lines of length not less than 10 words on line of English"
        }
    ]
)

print(response.choices[0].message.content)

Expected ChatGPT return all 50 lines

TheFirstNoob commented 2 days ago

@microcoder Hi, ChatGptEs provider have limitations for response token context. Replace provider like DDG or other. You can take list providers for this model on models.py file.

Tested with DDG provider:

Sure! Here are 50 lines, each containing at least 10 words:

1. The sun set behind the mountains, painting the sky with colors.
2. She walked through the forest, listening to the sounds of nature.
3. A gentle breeze rustled the leaves, creating a soothing melody.
4. The children laughed and played, their joy echoing through the park.
5. He opened the book and lost himself in its captivating story.
6. The aroma of freshly baked bread filled the air, making everyone hungry.
7. As the rain fell softly, she enjoyed the peaceful ambiance indoors.
8. The stars twinkled brightly in the night sky, a beautiful sight.
9. They gathered around the campfire, sharing stories and roasting marshmallows.
10. The city lights sparkled like diamonds, illuminating the bustling streets.
11. She painted a vibrant mural that brought life to the dull wall.
12. The sound of waves crashing against the shore was incredibly calming.
13. He trained hard every day, determined to achieve his athletic goals.
14. The garden bloomed with colorful flowers, attracting butterflies and bees.
15. They traveled to distant lands, seeking adventure and new experiences.
16. The old clock ticked steadily, marking the passage of time in silence.
17. She wrote a heartfelt letter, expressing her deepest feelings and thoughts.
18. The mountain trail was steep, but the view at the top was worth it.
19. He played the guitar beautifully, captivating everyone in the room.
20. The festival was filled with laughter, music, and delicious food everywhere.
21. She gazed out the window, lost in her thoughts and dreams.
22. The puppy wagged its tail excitedly, eager to play with its owner.
23. They danced under the stars, feeling the magic of the moment.
24. The library was a sanctuary, filled with knowledge and endless stories.
25. He cooked a delicious meal, impressing his friends with his skills.
26. The thunder rumbled in the distance, signaling an approaching storm.
27. She wore a bright smile, spreading positivity wherever she went.
28. The old tree stood tall, a witness to many seasons of change.
29. They explored the ancient ruins, imagining the lives of those who lived there.
30. The sound of laughter filled the air, creating a joyful atmosphere.
31. She discovered a hidden talent for painting that surprised everyone.
32. The train chugged along the tracks, taking passengers to their destinations.
33. He found solace in writing, pouring his heart onto the pages.
34. The sunset cast a warm glow over the tranquil lake, mesmerizing all.
35. They volunteered at the shelter, helping those in need with kindness.
36. The aroma of coffee wafted through the café, inviting customers inside.
37. She practiced yoga every morning, finding peace and balance in her life.
38. The children built a snowman, their laughter ringing through the winter air.
39. He gazed at the stars, pondering the mysteries of the universe.
40. The sound of the piano filled the room, creating a serene atmosphere.
41. They hiked through the mountains, marveling at the beauty of nature.
42. She cherished the moments spent with family, creating lasting memories together.
43. The artist showcased her work at the gallery, receiving praise from all.
44. The waves lapped gently at the shore, a rhythmic and calming sound.
45. He took a deep breath, ready to face the challenges ahead.
46. The vibrant colors of autumn leaves painted a stunning landscape outside.
47. They shared a quiet moment, enjoying each other's company in silence.
48. The festival brought together people from different cultures and backgrounds.
49. She embraced change, knowing it was a part of life's journey.
50. The sound of the bell signaled the end of another school day.

Feel free to let me know if you need anything else!